dragonfly.git
13 years agoUpdate for OpenSSL-1.0.0c.
Peter Avalos [Sun, 12 Dec 2010 00:32:54 +0000 (14:32 -1000)]
Update for OpenSSL-1.0.0c.

This primarily fixes CVE-2010-4180.  See NEWS and CHANGES for more details.

13 years agoMerge branch 'vendor/OPENSSL'
Peter Avalos [Sun, 12 Dec 2010 00:27:24 +0000 (14:27 -1000)]
Merge branch 'vendor/OPENSSL'

13 years agoImport OpenSSL-1.0.0c.
Peter Avalos [Sun, 12 Dec 2010 00:08:43 +0000 (14:08 -1000)]
Import OpenSSL-1.0.0c.

13 years agokernel - 48-core MP work
Matthew Dillon [Sat, 11 Dec 2010 23:47:01 +0000 (15:47 -0800)]
kernel - 48-core MP work

* Replace the cpu_contention_mask global with a per-token contention mask.

* Fold the lwkt.user_pri_sched feature into the scheduler and remove the
  sysctl.  The feature is now alwayws on.  The feature allows a lower
  priority non-contending thread to be scheduled in the face of a
  high-priority contending thread that would normally spin in the scheduler.

* A reschedule IPI is now performed when a high-priority contending thread
  might possibly resolve, which will kick the user process back into the
  kernel and allow rescheduling of the higher priority thread.

* Change the idle-cpu check semantics.  When a cpu's scheduler finds only
  contending threads it used to loop in the scheduler and the idle thread
  would be flagged to not halt.  We now allow the idle thread to halt in
  this case and expect to receive an IPI when any of the contending threads
  might possibly resolve.

  As a fringe benefit this should also benefit vkernels.

* lwkt_schedule() has been significantly simplified.  Or as I would say,
  decomplexified.

13 years agokernel - Have DDB print '?' for non-printable characters
Matthew Dillon [Sat, 11 Dec 2010 21:21:03 +0000 (13:21 -0800)]
kernel - Have DDB print '?' for non-printable characters

* When DDB prints something just use '?' for non-printable characters
  to try to avoid messing up the screen too much.

13 years agokernel - Change the discrete mplock into mp_token
Matthew Dillon [Sat, 11 Dec 2010 20:59:46 +0000 (12:59 -0800)]
kernel - Change the discrete mplock into mp_token

* Use a lwkt_token for the mp_lock.  This consolidates our longer-term
  spinnable locks (the mplock and tokens) into just tokens, making it
  easier to solve performance issues.

* Some refactoring of the token code was needed to guarantee the ordering
  when acquiring and releasing the mp_token vs other tokens.

* The thread switch code, lwkt_switch(), is simplified by this change
  though not necessarily faster.

* Remove td_mpcount, mp_lock, and other related fields.

* Remove assertions related to td_mpcount and friends, generally folding
  them into similar assertions for tokens.

13 years agokernel - Remove CACHE_*MPLOCK* macros & sysctl
Matthew Dillon [Sat, 11 Dec 2010 17:13:47 +0000 (09:13 -0800)]
kernel - Remove CACHE_*MPLOCK* macros & sysctl

* Remove the vfs.cache_mpsafe sysctl and related macros.  This has
  defaulted to 1 (mpsafe) for a while now and is no longer needed.

13 years agokernel - Mark pty devices D_MPSAFE
Matthew Dillon [Sat, 11 Dec 2010 17:09:39 +0000 (09:09 -0800)]
kernel - Mark pty devices D_MPSAFE

* Mark the pty devices D_MPSAFE.  They are protected by tty_token

13 years agoutilities - Fix top -M when the window does not have sufficient rows
Matthew Dillon [Sat, 11 Dec 2010 09:01:33 +0000 (01:01 -0800)]
utilities - Fix top -M when the window does not have sufficient rows

* Fixes a seg-fault.

13 years agokernel - Rearrange usched_bsd4.c a bit
Matthew Dillon [Sat, 11 Dec 2010 08:42:18 +0000 (00:42 -0800)]
kernel - Rearrange usched_bsd4.c a bit

* Rearrange the way the scheduler helpers are woken up.  This results in
  much better coverage on systems with large numbers of cpus.

  Tested on the 48-core opteron monster.

* Essentially we no longer do bogus wakeups of scheduler helpers, and the
  chaining has been fixed when a scheduler helper is unable to perform
  the operation it was scheduled for (it tries to find another idle cpu
  to forward to).

  Most cpumask operations are now performed while holding the spin lock.

13 years agokernel - Make swap, nullfs MPSAFE
Matthew Dillon [Sat, 11 Dec 2010 08:40:32 +0000 (00:40 -0800)]
kernel - Make swap, nullfs MPSAFE

* Mark the swap dummy mount as being MPSAFE so strategy operations do not
  acquire the mplock.

* Mark NULLFS mounts as being MPSAFE so operations do not acquire the
  mplock.  If the underlying VFS is not MPSAFE it will still acquire
  the mplock.

13 years agokernel - Record token & mplock collisions in thread->td_wmesg
Matthew Dillon [Sat, 11 Dec 2010 08:38:45 +0000 (00:38 -0800)]
kernel - Record token & mplock collisions in thread->td_wmesg

* Record token & mplock collisions which the lwkt thread schedule spins
  on in the thread wmesg, which will show up in ps, top, etc.

  This makes it a lot more obvious when a thread is stalling on a token
  or the mplock and is generally superior to the old per-cpu collision
  record.

13 years agokernel - Add debugging features
Matthew Dillon [Sat, 11 Dec 2010 08:35:29 +0000 (00:35 -0800)]
kernel - Add debugging features

* Add lwkt.mplock_backtrace to force the kernel to print a backtrace
  when it encounters a mplock collision.  This is a bit problematic
  though as the backtrace can sometimes crash the kernel.

* Allow lwkt.mplock_yield_delay to be set to 0.

13 years agokernel - Remove unnecessary mplock in sys_ofstat()
Matthew Dillon [Sat, 11 Dec 2010 08:31:19 +0000 (00:31 -0800)]
kernel - Remove unnecessary mplock in sys_ofstat()

* Remove get/rel_mplock around kern_fstat() in the 4.3 fstat compat
  function.

13 years agoamr(4): Some bugfixes.
Sascha Wildner [Sat, 11 Dec 2010 03:57:36 +0000 (04:57 +0100)]
amr(4): Some bugfixes.

* Add a missing devstat_end_transaction_buf(). Makes device stats actually
  work.

* Add a couple of missing cam_simq_release() calls.

13 years agokernel - Adjustments to if_igb
Matthew Dillon [Sat, 11 Dec 2010 02:10:22 +0000 (18:10 -0800)]
kernel - Adjustments to if_igb

* Change the spin lock to a token.  A spinlock is inappropriate here because
  the thread can block with it held (resulting in a panic).

* Use rid 0 when allocating a legacy interrupt, fixing an issue where
  the interrupt bus resource could not be allocated.

13 years agokernel - Set wmesg when spinning on a token or the mplock
Matthew Dillon [Sat, 11 Dec 2010 02:08:20 +0000 (18:08 -0800)]
kernel - Set wmesg when spinning on a token or the mplock

* When spinning on a token or the mplock set the wmesg so it shows up
  in ps and top output.

13 years agoutilities - Fix top formatting when > 9 cpus present
Matthew Dillon [Sat, 11 Dec 2010 01:38:21 +0000 (17:38 -0800)]
utilities - Fix top formatting when > 9 cpus present

* Change %1x format to %02d

13 years agoinstaller - Increase administrative swap size limit to 512G
Matthew Dillon [Fri, 10 Dec 2010 20:57:56 +0000 (12:57 -0800)]
installer - Increase administrative swap size limit to 512G

* Increase from 8G to 512G (which is the x86-64 default swap size limit).
  8G was too small either way.  Maybe the installer-enforced administrative
  limit should just be removed entirely.

13 years agoBring in an igb(4) manual page (from FreeBSD).
Sascha Wildner [Fri, 10 Dec 2010 12:04:36 +0000 (13:04 +0100)]
Bring in an igb(4) manual page (from FreeBSD).

13 years agomanual pages: Punctuation and whitespace cleanup.
Sascha Wildner [Fri, 10 Dec 2010 10:30:20 +0000 (11:30 +0100)]
manual pages: Punctuation and whitespace cleanup.

13 years agokernel - Fix MP system call performance regression
Matthew Dillon [Fri, 10 Dec 2010 07:53:44 +0000 (23:53 -0800)]
kernel - Fix MP system call performance regression

* The userland scheduler was unconditionally calling lwkt_switch()
  via userexit() (i.e. on every system call), creating unnecessary
  overhead and possibly also triggering a bsd4 scheduler event
  requiring a common spinlock.

* Rearrange the code slightly to reduce instances where lwkt_switch()
  is called.  We want to try to keep instances where a higher priority
  LWKT thread is potentially runnable or when the LWKT fairq accumulator
  for the current thread has been exhausted.

* This removes system call overhead multiplication on MP systems.  For
  example, on a 48-core box system call overhead when all 48 cpus are
  busy doing getuid() loops went from 10uS back down to 270nS (which
  is near the single-cpu test results).

13 years agokernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (3)
Matthew Dillon [Fri, 10 Dec 2010 07:12:20 +0000 (23:12 -0800)]
kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (3)

* Correct compile-time errors in vkernel64 build.

13 years agokernel - Simplify AP CPU reporting on x86-64
Matthew Dillon [Fri, 10 Dec 2010 07:11:32 +0000 (23:11 -0800)]
kernel - Simplify AP CPU reporting on x86-64

* Simplify the AP CPU kprintf()s to reduce console spew.

13 years agokernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (2)
Matthew Dillon [Fri, 10 Dec 2010 07:10:50 +0000 (23:10 -0800)]
kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (2)

* Fix mis-translation in previous commit

13 years agostyle(9) - Prefer a lack of case '?' fallthrough for getopt
Samuel J. Greear [Fri, 10 Dec 2010 06:35:33 +0000 (06:35 +0000)]
style(9) - Prefer a lack of case '?' fallthrough for getopt

* This also coincides with the example in getopt(3)

Discussed-with: swildner@

13 years agoMerge branch 'malloc_constructor'
Samuel J. Greear [Fri, 10 Dec 2010 06:16:57 +0000 (06:16 +0000)]
Merge branch 'malloc_constructor'

13 years agoMerge branch 'GCI2010'
Samuel J. Greear [Fri, 10 Dec 2010 06:16:48 +0000 (06:16 +0000)]
Merge branch 'GCI2010'

13 years agovkernel - Add usage()
Samuel J. Greear [Fri, 10 Dec 2010 04:58:22 +0000 (04:58 +0000)]
vkernel - Add usage()

* Adds a new argument -h, which prints extended usage information

* Prints typical usage information (same as manpage) when no arguments are
  specified or an invalid argument is given. Otherwise, error output is the
  same as before.

* Convert to sysexits(3)

Sponsored-By: Google Code-In
13 years agokernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds.
Matthew Dillon [Thu, 9 Dec 2010 22:09:17 +0000 (14:09 -0800)]
kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds.

* Increase SMP_MAXCPU to 63 for 64-bit builds.

* cpumask_t is 64 bits on 64-bit builds now.  It remains 32 bits on 32-bit
  builds.

* Add #define's for atomic_set_cpumask(), atomic_clear_cpumask, and
  atomic_cmpset_cpumask().  Replace all use cases on cpu masks with
  these functions.

* Add CPUMASK(), BSRCPUMASK(), and BSFCPUMASK() macros.  Replace all
  use cases on cpu masks with these functions.

  In particular note that (1 << cpu) just doesn't work with a 64-bit
  cpumask.

  Numerous bits of assembly also had to be adjusted to use e.g. btq instead
  of btl, etc.

* Change __uint32_t declarations that were meant to be cpu masks to use
  cpumask_t (most already have).

  Also change other bits of code which work on cpu masks to be more agnostic.
  For example, poll_cpumask0 and lwp_cpumask.

* 64-bit atomic ops cannot use "iq", they must use "r", because most x86-64
  do NOT have 64-bit immediate value support.

* Rearrange initial kernel memory allocations to start from KvaStart and
  not KERNBASE, because only 2GB of KVM is available after KERNBASE.

  Certain VM allocations with > 32G of ram can exceed 2GB.  For example,
  vm_page_array[].  2GB was not enough.

* Remove numerous mdglobaldata fields that are not used.

* Align CPU_prvspace[] for now.  Eventually it will be moved into a
  mapped area.  Reserve sufficient space at MPPTDI now, but it is
  still unused.

* When pre-allocating kernel page table PD entries calculate the number
  of page table pages at KvaStart and at KERNBASE separately, since
  the KVA space starting at KERNBASE caps out at 2GB.

* Change kmem_init() and vm_page_startup() to not take memory range
  arguments.  Instead the globals (virtual_start and virtual_end) are
  manipualted directly.

13 years agoperiodic(8): Adjust the bsdstats script to use drill(1) instead of dig(1).
Sascha Wildner [Thu, 9 Dec 2010 05:12:16 +0000 (06:12 +0100)]
periodic(8): Adjust the bsdstats script to use drill(1) instead of dig(1).

The check_dns() check is still wrong which is due to the setting of
IFS but until scrappy@ reports back, I won't touch that. For the
moment, it will succeed, but would also not fail in check_dns() if
the network was down.

Reported-by: Tim Darby <t+dfbsd@timdarby.net>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1927>

13 years agomfiutil(8): Fix a in the interval argument to the 'patrol auto' command.
Sascha Wildner [Thu, 9 Dec 2010 04:10:26 +0000 (05:10 +0100)]
mfiutil(8): Fix a in the interval argument to the 'patrol auto' command.

13 years agoswapcache.8: Fix typos.
Sascha Wildner [Thu, 9 Dec 2010 04:09:03 +0000 (05:09 +0100)]
swapcache.8: Fix typos.

13 years agodevattr(8): Fix weird style and perform some general cleanup.
Sascha Wildner [Thu, 9 Dec 2010 04:08:33 +0000 (05:08 +0100)]
devattr(8): Fix weird style and perform some general cleanup.

13 years agoFix installworld.
Sascha Wildner [Wed, 8 Dec 2010 15:42:06 +0000 (16:42 +0100)]
Fix installworld.

13 years agobitstring(3): Describe bit_fls and bit_nsearch.
Venkatesh Srinivas [Wed, 8 Dec 2010 06:55:34 +0000 (22:55 -0800)]
bitstring(3): Describe bit_fls and bit_nsearch.

13 years agobitstring.h: Add bit_fls to complement bit_ffs and bit_nsearch.
Venkatesh Srinivas [Wed, 8 Dec 2010 06:44:17 +0000 (22:44 -0800)]
bitstring.h: Add bit_fls to complement bit_ffs and bit_nsearch.

13 years agoImport vm_map_findspace(9) manpage from FreeBSD and add flags/align arguments.
Venkatesh Srinivas [Wed, 8 Dec 2010 06:37:25 +0000 (22:37 -0800)]
Import vm_map_findspace(9) manpage from FreeBSD and add flags/align arguments.

13 years agoKernel configs: Move twa(4) to the right place, too.
Sascha Wildner [Wed, 8 Dec 2010 02:38:38 +0000 (03:38 +0100)]
Kernel configs: Move twa(4) to the right place, too.

13 years agoClean up and sort the RAID sections in our configs.
Sascha Wildner [Wed, 8 Dec 2010 02:35:57 +0000 (03:35 +0100)]
Clean up and sort the RAID sections in our configs.

13 years agokernel: Serial numbers have to be either 2 chars minimum or not be a blank.
Sascha Wildner [Wed, 8 Dec 2010 00:50:07 +0000 (01:50 +0100)]
kernel: Serial numbers have to be either 2 chars minimum or not be a blank.

The hptiop(4) controller's logical disks have a " " (single space)
serial number, which caused /dev/serno/_ to be created.

13 years agohptiop(4): Fix device description.
Sascha Wildner [Wed, 8 Dec 2010 00:28:05 +0000 (01:28 +0100)]
hptiop(4): Fix device description.

13 years agohptiop(4): Add the hptiop(4) RAID driver.
Sascha Wildner [Tue, 7 Dec 2010 23:54:45 +0000 (00:54 +0100)]
hptiop(4): Add the hptiop(4) RAID driver.

The driver supports the following adapters:

* HighPoint RocketRAID 3020
* HighPoint RocketRAID 3120
* HighPoint RocketRAID 3122
* HighPoint RocketRAID 3220
* HighPoint RocketRAID 3320
* HighPoint RocketRAID 3410
* HighPoint RocketRAID 3510
* HighPoint RocketRAID 3511
* HighPoint RocketRAID 3520
* HighPoint RocketRAID 3521
* HighPoint RocketRAID 3522
* HighPoint RocketRAID 3540
* HighPoint RocketRAID 4320

It was tested with the 3120.

Many thanks to FreeBSD, from which this code was obtained.

13 years agoperiodic/security: fix warnings on a system with no packages installed
YONETANI Tomokazu [Tue, 7 Dec 2010 01:46:06 +0000 (10:46 +0900)]
periodic/security: fix warnings on a system with no packages installed

13 years agodevattr - a tool to expose the libdevattr functionality
Nolan Lum [Tue, 7 Dec 2010 06:03:30 +0000 (06:03 +0000)]
devattr - a tool to expose the libdevattr functionality

13 years agokernel - Enable e1000 / igb netif in module build
Matthew Dillon [Tue, 7 Dec 2010 03:27:46 +0000 (19:27 -0800)]
kernel - Enable e1000 / igb netif in module build

* Add if_igb to the module build, via e1000.

13 years agokernel - 64-bit memory & ncpus work
Matthew Dillon [Tue, 7 Dec 2010 03:24:30 +0000 (19:24 -0800)]
kernel - 64-bit memory & ncpus work

* Create a macro and bsr function for cpu masks in preparation for
  making cpumask_t 64 bits on 64-bit builds.  cpumask_t is still
  32 bits in this commit.

* Expand SMP_MAXCPUS to 31 for 64-bit builds in preparation for
  eventually expanding it to 63.

* Fix an array overflow when probing ncpus on 64-bit.

* Increase the boot-time kmap entries to accomodate large numbers of
  cpus.

* Clean up a few places where integer overflows could occur on
  64-bit machines with large amounts of ram.

  For the moment we are limited to 32G.  This will change in a
  followup commit.

13 years agokernel - Fix lapic mask for > 16 apic ids
Matthew Dillon [Mon, 6 Dec 2010 22:03:42 +0000 (14:03 -0800)]
kernel - Fix lapic mask for > 16 apic ids

* The lapic mask in the MP startup was only allowing for 16 apic ids,
  adjust the mask to allow for all 256.

* Supermicro now boots w/12 cpus and probably 24.  More work required
  to get it to boot w/48.

13 years agoamr(4): Return the correct error.
Sascha Wildner [Mon, 6 Dec 2010 20:21:53 +0000 (21:21 +0100)]
amr(4): Return the correct error.

error was not being set for two functions, and if these failed, 0 was
incorrectly returned.

13 years agoaac(4) & mfi(4): Fix masking bug.
Sascha Wildner [Mon, 6 Dec 2010 18:12:30 +0000 (19:12 +0100)]
aac(4) & mfi(4): Fix masking bug.

When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.

Taken-from: FreeBSD

13 years agomfi(4): Shorten some lines.
Sascha Wildner [Mon, 6 Dec 2010 17:57:55 +0000 (18:57 +0100)]
mfi(4): Shorten some lines.

Taken-from: FreeBSD

13 years agokernel - Provide descriptions for many net.inet sysctl's
Samuel J. Greear [Sun, 5 Dec 2010 05:09:15 +0000 (05:09 +0000)]
kernel - Provide descriptions for many net.inet sysctl's

* Switch net.inet.ip.dispatch_* to RD from RW

Submitted-by: Taras Klaskovsky
Sponsored-by: Google Code-In
13 years agokernel - mlockall: Return EINVAL for invalid flags combinations.
Venkatesh Srinivas [Sun, 5 Dec 2010 04:40:22 +0000 (20:40 -0800)]
kernel - mlockall: Return EINVAL for invalid flags combinations.

Reported by: swildner

13 years agoAdd a missing file for building libiconv into the kernel.
Sascha Wildner [Sun, 5 Dec 2010 04:01:00 +0000 (05:01 +0100)]
Add a missing file for building libiconv into the kernel.

13 years agoMake more things (HPFS, *_ICONV) buildable into the kernel.
Sascha Wildner [Sun, 5 Dec 2010 03:43:36 +0000 (04:43 +0100)]
Make more things (HPFS, *_ICONV) buildable into the kernel.

13 years agotest - Add test case for prior select(2)/EOF bug
Samuel J. Greear [Sun, 5 Dec 2010 03:24:28 +0000 (03:24 +0000)]
test - Add test case for prior select(2)/EOF bug

* This test reproduces the problem fixed in commit:
  57b24f4ee66aaaa59b54e9577b93253cf435672f

Issue: http://bugs.dragonflybsd.org/issue1809
Submitted-by: Johannes Hofmann
13 years agoRegenerate the pciconf(8) database
Sascha Wildner [Sun, 5 Dec 2010 00:05:35 +0000 (01:05 +0100)]
Regenerate the pciconf(8) database

...from the following files:

Hart:    Jan 22, 2008 (version 671)
Boemler: Dec  4, 2010
Mares:   Nov 24, 2010

13 years agoFix a typo and add PMAP_DEBUG to LINT.
Sascha Wildner [Sat, 4 Dec 2010 21:00:49 +0000 (22:00 +0100)]
Fix a typo and add PMAP_DEBUG to LINT.

13 years agokernel - remove extra crit_exit()
YONETANI Tomokazu [Sat, 4 Dec 2010 13:05:42 +0000 (22:05 +0900)]
kernel - remove extra crit_exit()

Those are leftover from 080c00e6fcafedf719b52e5de548a005201b0218 .

13 years agoinstaller: Fix a bug when /boot (HAMMER) or / (UFS) is are to be encrypted.
Sascha Wildner [Sat, 4 Dec 2010 02:20:29 +0000 (03:20 +0100)]
installer: Fix a bug when /boot (HAMMER) or / (UFS) is are to be encrypted.

The installer will warn that this is not possible, but previously left the
encryption flag set. Clear it.

13 years agodocs - Expand the swapcache(8) manual page
Matthew Dillon [Fri, 3 Dec 2010 21:37:32 +0000 (13:37 -0800)]
docs - Expand the swapcache(8) manual page

* Add a description for static and dynamic wear leveling and write-combining

13 years agokernel: Remove some PC98 remains.
Sascha Wildner [Fri, 3 Dec 2010 19:18:23 +0000 (20:18 +0100)]
kernel: Remove some PC98 remains.

These were either not caught when we removed support, or they came back
in later.

13 years agokernel - Remove unneeded critical sections from VM code, add pmap asserts
Matthew Dillon [Fri, 3 Dec 2010 16:48:05 +0000 (08:48 -0800)]
kernel - Remove unneeded critical sections from VM code, add pmap asserts

* Various bits of VM code now only need vm_token and no longer need
  a critical section.

* Add pmap_page_assertzero() assertions in a couple of places when
  PMAP_DEBUG is enabled.

* Add PMAP_DEBUG as a global kernel config option.

* Be a bit more conservative and clear PG_ZERO for all page table
  pages and not just terminal page table pages.  When such pages
  are finally freed they will be zero again due to the way the
  pmap code works but don't make that assumption.

13 years agokernel - Document ordering requirement in lwkt_cpusync_remote2()
Matthew Dillon [Fri, 3 Dec 2010 16:38:01 +0000 (08:38 -0800)]
kernel - Document ordering requirement in lwkt_cpusync_remote2()

* Add a cpu_ccfence() to document necessary ordering but assume
  that the atomic op following handles the actual requirement.

  This is essentially a nop.

13 years agoAdd sha256/512 support to libcrypt, change default
Nolan Lum [Wed, 1 Dec 2010 21:49:53 +0000 (16:49 -0500)]
Add sha256/512 support to libcrypt, change default

* Add sha256 and sha512 support to libcrypt.

* Change the default password hash to sha256.

* All old passwords will of course still works, but all new ones will be
  created using sha256.

Sponsored-by: Google Code-In
13 years agoamr(4): Sync with FreeBSD.
Sascha Wildner [Fri, 3 Dec 2010 13:34:47 +0000 (14:34 +0100)]
amr(4): Sync with FreeBSD.

This adds support for various new devices (full list is in the manual
page), among other things.

Reported-by: Tomaz Borstnar <tomaz.borstnar@over.net>
               Jonas Trollvik <jontro@gmail.com>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue305>

13 years agomfi(4): Add missing dev_ops_remove_minor().
Sascha Wildner [Fri, 3 Dec 2010 13:21:03 +0000 (14:21 +0100)]
mfi(4): Add missing dev_ops_remove_minor().

13 years agokernel - Fix bug in x86-64 version of bzeront()
Matthew Dillon [Fri, 3 Dec 2010 02:11:29 +0000 (18:11 -0800)]
kernel - Fix bug in x86-64 version of bzeront()

* The x86-64 bzeront code was subtracting the wrong value from the count
  when looping.  Note that prior to this commit the code was not being
  used anyway.

* Rearrange the way movnti support is detected and enable for x86-64.

13 years agodm - undo my pointless moving of dm.h
Alex Hornung [Thu, 2 Dec 2010 11:03:11 +0000 (11:03 +0000)]
dm - undo my pointless moving of dm.h

* There was no need to move dm.h, we can just use <dev/disk/dm/dm.h>.

* And since we can do the above, we can also get rid of the strange
  Makefile CFLAGS magic I added.

* Also undo the removal on upgrade of /usr/include/dev/disk/dm/dm.h and
  instead remove sys/dm.h

Reported-by: Sascha Wildner
13 years agoRemove <dev/disk/dm/dm.h> via make upgrade. It's <sys/dm.h> now.
Sascha Wildner [Thu, 2 Dec 2010 11:50:33 +0000 (12:50 +0100)]
Remove <dev/disk/dm/dm.h> via make upgrade. It's <sys/dm.h> now.

13 years agostyle.9: Somehow, half of the usage() example was missing. Fix it.
Sascha Wildner [Thu, 2 Dec 2010 10:06:37 +0000 (11:06 +0100)]
style.9: Somehow, half of the usage() example was missing. Fix it.

Noticed-by: sjg
13 years agokernel - Provide descriptions for many net.inet6 sysctl's
Samuel J. Greear [Thu, 2 Dec 2010 09:34:13 +0000 (09:34 +0000)]
kernel - Provide descriptions for many net.inet6 sysctl's

Submitted-by: Taras Klaskovsky
Sponsored-by: Google Code-In
13 years agomfi(4): Make mfi_linux.ko compile (maybe it even works).
Sascha Wildner [Wed, 1 Dec 2010 21:18:19 +0000 (22:18 +0100)]
mfi(4): Make mfi_linux.ko compile (maybe it even works).

I haven't tested this yet.

13 years agovga/vesa: Use hexdump() instead of cooking our own.
Sascha Wildner [Wed, 1 Dec 2010 19:51:56 +0000 (20:51 +0100)]
vga/vesa: Use hexdump() instead of cooking our own.

13 years agoAdd a hexdump(9) manual page (taken from FreeBSD).
Sascha Wildner [Wed, 1 Dec 2010 19:04:36 +0000 (20:04 +0100)]
Add a hexdump(9) manual page (taken from FreeBSD).

13 years agokernel - Fix mbuf header exhaustion w/ degenerate unix domain socket case
Matthew Dillon [Wed, 1 Dec 2010 17:55:39 +0000 (09:55 -0800)]
kernel - Fix mbuf header exhaustion w/ degenerate unix domain socket case

* Increase the number of mbuf headers to accomodate a degenerate
  fd-passing case with chains of unix domain sockets, one fd per
  socket.

* This does not address other mbuf exhaustion issues which can crop
  up in a user ddos attack due to the default number of fds a user
  is allowed to own.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
13 years agokernel - Fix deep stack recursion in unix domain socket garbage collection
Matthew Dillon [Wed, 1 Dec 2010 17:53:08 +0000 (09:53 -0800)]
kernel - Fix deep stack recursion in unix domain socket garbage collection

* A chain of unix domain sockets with the previous fd passed into the
  next one can cause a kernel stack overflow.

* Flatten the portion of the gc which would otherwise recurse by placing
  the fp on a list instead of calling a nested closef(), then running
  the closes at the top level.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
13 years agoinstaller - encrypted root fix for new modules
Alex Hornung [Wed, 1 Dec 2010 15:25:06 +0000 (15:25 +0000)]
installer - encrypted root fix for new modules

* With the new modularized dm, dm_target_crypt will have to be loaded
  explicitly if the module_path is not reachable in the moment the crypt
  target is needed.

* Simply write dm_target_crypt_load="YES" to the installed loader.conf
  so that there are no nasty surprises.

Reported-by: Sascha Wildner
13 years agodm - Modularize it fully
Alex Hornung [Wed, 1 Dec 2010 10:17:55 +0000 (10:17 +0000)]
dm - Modularize it fully

* Move each of the targets (except error and zero) into a subdirectory
  in targets/.

* Change the macro DM_TARGET_MODULE to also let the module depend on dm.

* Add a new macro DM_TARGET_BUILTIN, which must be used instead of
  DM_TARGET_MODULE for targets that are compiled into the main dm.ko
  instead of a separate module. Not doing this will prevent dm.ko from
  unloading.

* Enable automatic loading of target modules if they aren't builtin or
  loaded yet. Automatically loaded modules can be unloaded via kldunload
  safely via a little hack (see source).

* NOTE: automatic loading doesn't always work. /boot must be mounted
  already, so if you are planning on encrypting your swap or similar
  stuff, you need to *EXPLICITLY* load dm_target_crypt.ko via the
  loader.

* NOTE: PLEASE NOTE THE NOTE ABOVE!

* Fix a little issue with dm_target_crypt that would print "unloaded"
  even if it wouldn't unload.

* Change the name of dm_target_stripe to dm_target_striped, since the
  target is actually called "striped".

* Move dm.h to sys/sys/dm.h

* Get rid of files.dm, a leftover from the import

13 years agoUnbreak buildworld.
Sascha Wildner [Wed, 1 Dec 2010 08:29:48 +0000 (09:29 +0100)]
Unbreak buildworld.

13 years agokernel - Replace broken mp lock in bounce pages swi_vm() with spinlock
Matthew Dillon [Wed, 1 Dec 2010 06:01:15 +0000 (22:01 -0800)]
kernel - Replace broken mp lock in bounce pages swi_vm() with spinlock

* Replace old non-MPSAFE crit section and mplock code with a spinlock

* x86-64 was not registering swi_vm(), add that code in.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
13 years agokernel - Fix NFS race
Matthew Dillon [Wed, 1 Dec 2010 05:59:52 +0000 (21:59 -0800)]
kernel - Fix NFS race

* The nfsnode code could in very rare circumstances double-vput a vnode,
  creating havoc.

13 years agokernel - vm_mmap: Remove Advertising clause and DragonFly CVSID.
Venkatesh Srinivas [Wed, 1 Dec 2010 03:39:50 +0000 (19:39 -0800)]
kernel - vm_mmap: Remove Advertising clause and DragonFly CVSID.

13 years agommcsd(4): Enhance readability by using a variable for the buf pointer.
Sascha Wildner [Wed, 1 Dec 2010 02:44:50 +0000 (03:44 +0100)]
mmcsd(4): Enhance readability by using a variable for the buf pointer.

13 years agohammer.8: Fix typo.
Sascha Wildner [Wed, 1 Dec 2010 01:44:29 +0000 (02:44 +0100)]
hammer.8: Fix typo.

13 years agomfi(4): Add device statistics.
Sascha Wildner [Wed, 1 Dec 2010 01:28:24 +0000 (02:28 +0100)]
mfi(4): Add device statistics.

13 years agocondvar - Constify
Stathis Kamperis [Tue, 30 Nov 2010 16:31:35 +0000 (18:31 +0200)]
condvar - Constify

13 years agomfi(4): Remove the unused MFI_DECODE_LOG option.
Sascha Wildner [Tue, 30 Nov 2010 18:27:34 +0000 (19:27 +0100)]
mfi(4): Remove the unused MFI_DECODE_LOG option.

13 years agomfi(4): Add the mfi(4) RAID driver and the mfiutil(8) configuration tool.
Sascha Wildner [Tue, 30 Nov 2010 16:49:07 +0000 (17:49 +0100)]
mfi(4): Add the mfi(4) RAID driver and the mfiutil(8) configuration tool.

The driver supports the following adapters:

* LSI MegaRAID SAS 1078
* LSI MegaRAID SAS 8408E
* LSI MegaRAID SAS 8480E
* LSI MegaRAID SAS 9260
* Dell PERC5
* Dell PERC6
* IBM ServeRAID M5015 SAS/SATA
* IBM ServeRAID-MR10i
* Intel RAID Controller SROMBSAS18E

It was tested with the LSI MegaRAID SAS 8408E card.

Many thanks to FreeBSD, from which this code was obtained.

13 years agokernel: Bring in hexdump() from FreeBSD.
Sascha Wildner [Mon, 29 Nov 2010 02:38:14 +0000 (03:38 +0100)]
kernel: Bring in hexdump() from FreeBSD.

13 years agomlockall.2: Fix month name and remove trailing whitespace.
Sascha Wildner [Tue, 30 Nov 2010 15:28:23 +0000 (16:28 +0100)]
mlockall.2: Fix month name and remove trailing whitespace.

13 years agoMerge branch 'GCI2010'
Samuel J. Greear [Tue, 30 Nov 2010 05:01:38 +0000 (05:01 +0000)]
Merge branch 'GCI2010'

13 years agokernel - Provide descriptions for lwkt.* and debug.* sysctl's
Samuel J. Greear [Tue, 30 Nov 2010 04:42:32 +0000 (04:42 +0000)]
kernel - Provide descriptions for lwkt.* and debug.* sysctl's

* Take the opportunity to chop a few dead sysctl's as well

Submitted-by: Taras Klaskovsky
Sponsored-by: Google Code-In
13 years agoMerge branch 'master' of git://crater.dragonflybsd.org/dragonfly
Joe Talbott [Tue, 30 Nov 2010 02:11:17 +0000 (21:11 -0500)]
Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly

13 years agounp_connect() - Use euid/egid for access checks via VOP_EACCESS().
Joe Talbott [Tue, 30 Nov 2010 02:03:20 +0000 (21:03 -0500)]
unp_connect() - Use euid/egid for access checks via VOP_EACCESS().

Fixes socket access for set[ug]id applications by using the euid/egid
rather than the uid/gid.

Reported-By: Tim Darby <t+dfbsd@timdarby.net>
13 years agokernel - Run pfil hooks for bridged packets
Matthew Dillon [Mon, 29 Nov 2010 19:38:33 +0000 (11:38 -0800)]
kernel - Run pfil hooks for bridged packets

* The pfil hooks were not being run in all cases for bridged packets.

Submitted-by: Rumko <rumcic@gmail.com>
13 years agokernel - tmpfs - Remove mplock in tmpfs_read().
Venkatesh Srinivas [Mon, 29 Nov 2010 19:23:38 +0000 (11:23 -0800)]
kernel - tmpfs - Remove mplock in tmpfs_read().

13 years agoImport mlockall(2)/munlockall(2) manpage from OpenBSD and modify for Dfly.
Venkatesh Srinivas [Mon, 29 Nov 2010 16:46:27 +0000 (08:46 -0800)]
Import mlockall(2)/munlockall(2) manpage from OpenBSD and modify for Dfly.

13 years agodm - access io_cnt atomically
Alex Hornung [Mon, 29 Nov 2010 08:02:08 +0000 (08:02 +0000)]
dm - access io_cnt atomically

* Now that we are using shared locks at some points, only update the
  io_cnt atomically, otherwise we can mess things up.

13 years agodm - misc minor cleanup
Alex Hornung [Fri, 26 Nov 2010 14:23:12 +0000 (15:23 +0100)]
dm - misc minor cleanup

* remove dead code, weird white spaces and fix comments.