dragonfly.git
12 years agoem: rman_get_cpuid should be used to get the interrupt's target CPU
Sepherosa Ziehau [Wed, 28 Dec 2011 13:53:41 +0000 (21:53 +0800)]
em: rman_get_cpuid should be used to get the interrupt's target CPU

12 years agoem: Use MSI, if device supports it
Sepherosa Ziehau [Wed, 28 Dec 2011 05:09:13 +0000 (13:09 +0800)]
em: Use MSI, if device supports it

12 years agobce: Split out frontend for interrupt handler
Sepherosa Ziehau [Wed, 28 Dec 2011 04:07:22 +0000 (12:07 +0800)]
bce: Split out frontend for interrupt handler

For non-oneshot MSI, we don't need to make sure that status block has
been updated and we don't need extra register read to flush the ACK_CMD;
MSI has already made sure about those.

For oneshot MSI, we don't even need to ACK the interrupt

Obtaied-from: bnx2

12 years agopci: Factor out pci_alloc_1intr()
Sepherosa Ziehau [Wed, 28 Dec 2011 02:49:50 +0000 (10:49 +0800)]
pci: Factor out pci_alloc_1intr()

This function will properly setup rid and flags for "legacy" interrupt.
If MSI is enabled, then this function will try allocate 1 MSI message
and setup rid and flags properly for MSI based interrupt resource.

12 years agoether_ioctl: Command type is u_long not int
Sepherosa Ziehau [Tue, 27 Dec 2011 10:15:26 +0000 (18:15 +0800)]
ether_ioctl: Command type is u_long not int

12 years agotaskqueue -- Register swi_taskq_mp as an MP-safe SWI.
Venkatesh Srinivas [Wed, 28 Dec 2011 01:38:12 +0000 (17:38 -0800)]
taskqueue -- Register swi_taskq_mp as an MP-safe SWI.

The swi_taskqueue for mpsafe tasks was still getting the mplock. Remove it.
There are no real users of this queue in kernel though.

12 years agotest - Do not report bogus object pointer in vmpageinfo
Matthew Dillon [Tue, 27 Dec 2011 22:18:34 +0000 (14:18 -0800)]
test - Do not report bogus object pointer in vmpageinfo

* If m.object is NULL do not report the previously loaded object's
  data in the output.

12 years agokernel - Fix swap space leak
Matthew Dillon [Tue, 27 Dec 2011 22:15:50 +0000 (14:15 -0800)]
kernel - Fix swap space leak

* swp_pager_meta_free_callback() had a bug where the last swap block
  in the swblock{} structure was not being freed from the swap bitmap.

* Also fix two rare race conditions.  swp_pager_freeswapspace() can
  block, causing the VM object token to be temporarily unlocked.  Deal
  with the race by not decrementing the swb_count field until after
  swp_pager_freeswapspace() is called.

Reported-by: sephe
12 years agoi386: Pass cpuid to pcib_alloc_msi and pcib_map_msi
Sepherosa Ziehau [Tue, 27 Dec 2011 08:19:17 +0000 (16:19 +0800)]
i386: Pass cpuid to pcib_alloc_msi and pcib_map_msi

This also unbreaks kernel building on i386

12 years agobce: Use MSI, if device supports it
Sepherosa Ziehau [Tue, 27 Dec 2011 06:38:13 +0000 (14:38 +0800)]
bce: Use MSI, if device supports it

12 years agoemx: emx_detach will correctly handle IRQ resource allocation failure
Sepherosa Ziehau [Tue, 27 Dec 2011 06:37:24 +0000 (14:37 +0800)]
emx: emx_detach will correctly handle IRQ resource allocation failure

12 years agoemx: Use MSI, if device supports it
Sepherosa Ziehau [Tue, 27 Dec 2011 05:43:09 +0000 (13:43 +0800)]
emx: Use MSI, if device supports it

12 years agoahci: Use MSI if device support it.
Sepherosa Ziehau [Tue, 27 Dec 2011 05:42:44 +0000 (13:42 +0800)]
ahci: Use MSI if device support it.

12 years agomsi: Put old MSI code under OLD_MSI
Sepherosa Ziehau [Tue, 27 Dec 2011 05:41:31 +0000 (13:41 +0800)]
msi: Put old MSI code under OLD_MSI

12 years agox86_64: Don't allocate MSI if LAPIC is not enabled
Sepherosa Ziehau [Tue, 27 Dec 2011 05:09:38 +0000 (13:09 +0800)]
x86_64: Don't allocate MSI if LAPIC is not enabled

12 years agomsi/pci: Adjust pci_alloc_msi method interface
Sepherosa Ziehau [Tue, 27 Dec 2011 03:23:03 +0000 (11:23 +0800)]
msi/pci: Adjust pci_alloc_msi method interface

- The requested number of MSI messages is no longer adjusted in
  pci_alloc_msi_method(), instead, caller should adjust it.
- rids of the MSI SYS_RES_IRQ are explicitly returned to caller,
  instead of letting caller fill them based on the implied rules.
- MSI messages' target CPU auto-selection.
- Intead of reallocation using reduced number of MSI messages,
  we try to allocate the requested amount of MSI messages on
  different CPUs, if the desired CPU does not have enough vectors.
- The requested amount of MSI messages must be sane.

12 years agox86_64/msi: Add hw.ioapic.msi_start tunable
Sepherosa Ziehau [Mon, 26 Dec 2011 13:26:34 +0000 (21:26 +0800)]
x86_64/msi: Add hw.ioapic.msi_start tunable

This is mainly used to test MSI allocation over the whole valid
hardware interrupt space.

12 years agox86_64: Add MSI support for IOAPIC MachIntrABI
Sepherosa Ziehau [Sun, 25 Dec 2011 14:13:13 +0000 (22:13 +0800)]
x86_64: Add MSI support for IOAPIC MachIntrABI

12 years agopci: Remove extra bus_generic_teardown_intr
Sepherosa Ziehau [Sun, 25 Dec 2011 14:02:23 +0000 (22:02 +0800)]
pci: Remove extra bus_generic_teardown_intr

This is the left over of 79af06ab6b5a6581a07d0a6bc0735f6aa82a7947

12 years agomsi: Add setup/map function
Sepherosa Ziehau [Sun, 25 Dec 2011 11:46:03 +0000 (19:46 +0800)]
msi: Add setup/map function

- msi_setup, setup the IDT entry properly
- msi_map, return the MSI address and MSI data according to the
  'intr' and 'cpuid'

The various MSI macros forming MSI address/data are taken from FreeBSD

12 years agomsi: Generate vectors 0~15
Sepherosa Ziehau [Sun, 25 Dec 2011 11:24:27 +0000 (19:24 +0800)]
msi: Generate vectors 0~15

12 years agomsi/pci: Pass cpuid to pcib_map_msi method
Sepherosa Ziehau [Sun, 25 Dec 2011 10:38:25 +0000 (18:38 +0800)]
msi/pci: Pass cpuid to pcib_map_msi method

12 years agox86_64: Add setidt(), which setup an IDT entry on the specified cpu
Sepherosa Ziehau [Sat, 24 Dec 2011 16:27:40 +0000 (00:27 +0800)]
x86_64: Add setidt(), which setup an IDT entry on the specified cpu

12 years agomsi/pci: Pass cpuid to pcib_release_msi method
Sepherosa Ziehau [Sat, 24 Dec 2011 14:11:10 +0000 (22:11 +0800)]
msi/pci: Pass cpuid to pcib_release_msi method

12 years agopci: We must not enable pci_do_msix currently
Sepherosa Ziehau [Sat, 24 Dec 2011 12:12:07 +0000 (20:12 +0800)]
pci: We must not enable pci_do_msix currently

12 years agomsi/pci: Pass cpuid to pci_alloc_msi and pcib_alloc_msi methods
Sepherosa Ziehau [Sat, 24 Dec 2011 12:09:18 +0000 (20:09 +0800)]
msi/pci: Pass cpuid to pci_alloc_msi and pcib_alloc_msi methods

12 years agonetif: MSI actually never worked, so comment out the pci_alloc_msi
Sepherosa Ziehau [Sat, 24 Dec 2011 12:08:24 +0000 (20:08 +0800)]
netif: MSI actually never worked, so comment out the pci_alloc_msi

12 years agomsi: Enable all PCI related code
Sepherosa Ziehau [Fri, 23 Dec 2011 15:02:45 +0000 (23:02 +0800)]
msi: Enable all PCI related code

12 years agomsi: Add interrupt vectors
Sepherosa Ziehau [Fri, 23 Dec 2011 14:41:17 +0000 (22:41 +0800)]
msi: Add interrupt vectors

This is larged based on apic/apic_vector.s

12 years agoUPDATING: Note that mkdir(1) and install(1) need updating before building.
Sascha Wildner [Tue, 27 Dec 2011 02:47:45 +0000 (03:47 +0100)]
UPDATING: Note that mkdir(1) and install(1) need updating before building.

12 years agoinstaller: Don't say the installer is experimental.
Sascha Wildner [Tue, 27 Dec 2011 02:33:26 +0000 (03:33 +0100)]
installer: Don't say the installer is experimental.

Noticed-by: vsrinivas
12 years agokernel - Add vm.swapcache.maxscan
Matthew Dillon [Mon, 26 Dec 2011 20:01:49 +0000 (12:01 -0800)]
kernel - Add vm.swapcache.maxscan

* Add vm.swapcache.maxscan as a separate counter from vm.swapcache.maxlaunder.

* Defaults to 4x maxlaunder.

* Should hopefully fix another cpu hogging issue that was noticed on
  avalon when most VM pages wind up being cached in the swapcache
  but still get cycled in the PQ_INACTIVE VM page queue due to apache
  activity.

12 years agokernel -- Per-mount syncer thread infrastructure.
Venkatesh Srinivas [Mon, 26 Dec 2011 08:12:14 +0000 (00:12 -0800)]
kernel -- Per-mount syncer thread infrastructure.

Introduce infrastructure to create per-mount periodic filesystem syncer threads.

For a filesystem flagged MNTK_THR_SYNC, create a thread to periodically
synchronize dirty vnodes and the entire filesystem via VOP_FSYNC and
VFS_SYNC. This thread subsumes that responsibility from the global syncer.
The thread will be created at mount time and torn down at unmount.

For filesystems not flagged, the global syncer thread (syncer0) is still used.
The global syncer thread is also used for the bioops_sync(NULL) call, to
invoke every filesystem's bioops_sync path. This is primarily a concern for
UFS/softdep. The global syncer is also the only syncer thread to respond to
speedup_syncer / rushjob requests; this is again a consideration for softdep.

Future work will consider the relative phase of the syncer thread clocks,
so that they may wake together; this may result in more work done per
wakeup.

Currently no filesystems are flagged MNTK_THR_SYNC, so there should be no
functional change associated with this commit.

12 years agokernel - Fix missing chain wait
Matthew Dillon [Sun, 25 Dec 2011 22:32:29 +0000 (14:32 -0800)]
kernel - Fix missing chain wait

* Fix a missing chain wait prior to adding a ref to the VM object in the
  sysv shm code.

Reported-by: lentferj
12 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 25 Dec 2011 22:32:19 +0000 (14:32 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

12 years ago<math.h>: Add prototypes for llrintl() and nearbyintl().
Sascha Wildner [Sun, 25 Dec 2011 21:42:11 +0000 (22:42 +0100)]
<math.h>: Add prototypes for llrintl() and nearbyintl().

12 years ago<math.h>: Add FP_ILOGB0 and FP_ILOGBNAN.
Sascha Wildner [Sun, 25 Dec 2011 21:41:15 +0000 (22:41 +0100)]
<math.h>: Add FP_ILOGB0 and FP_ILOGBNAN.

12 years agokernel - Correct sysctl variable type for kern.stackgap_random
Matthew Dillon [Sun, 25 Dec 2011 22:06:29 +0000 (14:06 -0800)]
kernel - Correct sysctl variable type for kern.stackgap_random

* Correct the sysctl variable type for kern.stackgap_random from an
  unsigned int to a signed int.

12 years agogcc-4.4: Add workaround for probable AMD cpu bug
Matthew Dillon [Sun, 25 Dec 2011 22:02:24 +0000 (14:02 -0800)]
gcc-4.4: Add workaround for probable AMD cpu bug

* Add a workaround to add a nop to the end of gcc-4.4's fill_sons_in_loop()
  function just prior to its return (to its multi-register pop and ret
  sequence).

  This works around what appears to be a aMD cpu bug in contemporary
  AMD cpus.

12 years agokernel - Add workaround support for a probable AMD cpu bug related to cc1
Matthew Dillon [Sun, 25 Dec 2011 21:47:39 +0000 (13:47 -0800)]
kernel - Add workaround support for a probable AMD cpu bug related to cc1

* Add supporting inlines and a #define.  See the followup commit to
  the gcc-4.4 code in the DFly codebase.

* This bit of code is used to add a single NOP instruction just prior to
  the pop/ret sequence in cc1's fill_sons_in_loop() which works around
  what we believe to be a very difficult to reproduce AMD cpu bug.  The
  bug appears to be present on contemporary AMD cpus and was replicated
  on a Phenom(tm) II X4 820 Processor (Origin = "AuthenticAMD"  Id = 0x100f42
  Stepping = 2) and on an opteron 12-core cpu AMD Opteron(tm) Processor 6168
  (Origin = "AuthenticAMD"  Id = 0x100f91  Stepping = 1).

* The bug is extremely sensitive to %rip and %rsp values as well as
  stack memory use patterns and appears to cause either the %rip or the
  %rsp to become corrupt during the multi-register-pop/ret sequence at
  the end of fill_sons_in_loop() in the GCC 4.4.7 codebase.  This
  procedure is called as part of a deep tree recursion which exercises both
  the AMD RAS (Return Address Stack) hardware circuitry and probably also
  the write combining circuitry.

* I have so far only been able to reproduce the bug on DragonFly but have
  to the best of my ability eliminated the OS as a possible source of the
  problem over the last few months.  I am currently attempting to reproduce
  the bug running FreeBSD on the same hardware but it's virtually impossible
  to replicate the exact environment without adding DragonFly binary emulation
  to FreeBSD (which I just might have to do to truly verify that the bug is
  not a DragonFly OS bug).

* Bug reproducability: DragonFly utilizes a 0-1023 (~16 byte aligned)
  random stack gap.  Under normal buildworld -j 25 or similar conditions
  it can take anywhere up to 2 days to cause a failure.  Using a fixed
  stack gap of 904 (sysctl kern.stackgap_random=-904) on a particular cc1
  line during the compilation of gcc-4.4 using gcc-4.4, compiling gcc/mcf.c,
  with a carefully constructed environment and command path (to replicate
  a precise starting stack %rsp of  for main() of 0x7fffffffe818), I was
  able to replicate the bug in around a 60-second time frame with
  approximately one out of every 16 compiles hitting the the bug and failing.

* Changing the stackgap and/or modifying the code in any way (e.g. causing a
  shift in the %rpc values) changes the characteristics of the bug, sometimes
  causing it to stop appearing entirely.

  It was found that an adjustment of the stackgap in 32768 byte increments
  starting at the gap known to fail also reproduces the bug with the same
  consistency as the original stackgap value.

* Only the fill_sons_in_loop() function in cc1 in a few particular cases
  appears to be able to trigger the bug, across all the compiles we've
  done over a year.

12 years agosh: Add tests for lines that look like heredoc delimiters but are not.
Peter Avalos [Sun, 25 Dec 2011 18:02:37 +0000 (10:02 -0800)]
sh: Add tests for lines that look like heredoc delimiters but are not.

Obtained-from:  FreeBSD 221887

12 years agosh: Add tests for some somewhat obscure aspects of function definitions.
Peter Avalos [Sun, 25 Dec 2011 18:01:22 +0000 (10:01 -0800)]
sh: Add tests for some somewhat obscure aspects of function definitions.

Obtained-from:  FreeBSD 222512

12 years agosh: Add some testcases for pasting $*/$@ directly to a literal.
Peter Avalos [Sun, 25 Dec 2011 17:59:17 +0000 (09:59 -0800)]
sh: Add some testcases for pasting $*/$@ directly to a literal.

Obtained-from:  FreeBSD 228873

12 years agosh: Add test for positional parameters with more than one digit.
Peter Avalos [Sun, 25 Dec 2011 17:58:14 +0000 (09:58 -0800)]
sh: Add test for positional parameters with more than one digit.

Obtained-from:  FreeBSD 222158

12 years agosh: Add testcase for $? in here-document.
Peter Avalos [Sun, 25 Dec 2011 17:56:19 +0000 (09:56 -0800)]
sh: Add testcase for $? in here-document.

Obtained-from:  FreeBSD 222715

12 years agosh: Add simple tests for set -x and PS4.
Peter Avalos [Sun, 25 Dec 2011 17:54:50 +0000 (09:54 -0800)]
sh: Add simple tests for set -x and PS4.

Obtained-from:  FreeBSD 222882

12 years agosh: Add tests for -n flag.
Peter Avalos [Sun, 25 Dec 2011 17:53:24 +0000 (09:53 -0800)]
sh: Add tests for -n flag.

Obtained-from:  FreeBSD 222661

12 years agosh: Add forgotton test for set.
Peter Avalos [Sun, 25 Dec 2011 17:50:07 +0000 (09:50 -0800)]
sh:  Add forgotton test for set.

Obtained-from:  FreeBSD 222813

12 years agosh: Add test for 332546d32a797c819b3a1804e66be73417674ff1.
Peter Avalos [Sun, 25 Dec 2011 17:45:20 +0000 (09:45 -0800)]
sh:  Add test for 332546d32a797c819b3a1804e66be73417674ff1.

Obtained-from:  FreeBSD 222174

12 years agosh: Test that . /dev/null returns exit status 0 and does not preserve $?.
Peter Avalos [Sun, 25 Dec 2011 17:43:46 +0000 (09:43 -0800)]
sh: Test that . /dev/null returns exit status 0 and does not preserve $?.

Preserving $? may cause problems particularly if set -e is in effect.

It may be useful to preserve the old value of $? in the dot script but this
must not be implemented in such a way that it would break this test.

Obtained-from:  FreeBSD 219390

12 years agosh: Add simple CDPATH test.
Peter Avalos [Sun, 25 Dec 2011 17:42:34 +0000 (09:42 -0800)]
sh: Add simple CDPATH test.

Obtained-from:  FreeBSD 222379

12 years agosh: Add test for LC_COLLATE-based character ranges in case.
Peter Avalos [Sun, 25 Dec 2011 17:41:23 +0000 (09:41 -0800)]
sh: Add test for LC_COLLATE-based character ranges in case.

Obtained-from:  FreeBSD 223011

12 years agosh: Add tests for some corner cases of 'case' exit status.
Peter Avalos [Sun, 25 Dec 2011 17:38:33 +0000 (09:38 -0800)]
sh: Add tests for some corner cases of 'case' exit status.

Obtained-from:  FreeBSD 228007

12 years agosh: Add test for exit status of for loop without items.
Peter Avalos [Sun, 25 Dec 2011 17:35:56 +0000 (09:35 -0800)]
sh: Add test for exit status of for loop without items.

POSIX says the exit status of a for loop without any items shall be 0.
There are no exceptions if the exit status of the previous command was
not 0 or if the item list contains a command substitution with non-zero
exit status.

Obtained-from:  FreeBSD 226892

12 years agosh: Add a test for a fairly obscure case with aliases.
Peter Avalos [Sun, 25 Dec 2011 17:34:40 +0000 (09:34 -0800)]
sh: Add a test for a fairly obscure case with aliases.

Obtained-from:  FreeBSD 224104

12 years agosh: Test that '!' is literal if quoted and first char of bracket expr
Peter Avalos [Sun, 25 Dec 2011 17:33:08 +0000 (09:33 -0800)]
sh: Test that '!' is literal if quoted and first char of bracket expr

Obtained-from:  FreeBSD 223546

12 years agosh: Add test for df6b9adb7f429266f4faf79629df957f76d736f3.
Peter Avalos [Sun, 25 Dec 2011 17:30:32 +0000 (09:30 -0800)]
sh:  Add test for df6b9adb7f429266f4faf79629df957f76d736f3.

Obtained-from:  FreeBSD 223283

12 years agosh: Remove impossible evalskip check in 'for'.
Peter Avalos [Sun, 25 Dec 2011 17:22:49 +0000 (09:22 -0800)]
sh: Remove impossible evalskip check in 'for'.

Obtained-from:  FreeBSD 228015

12 years agosh: Reduce one level of evaltree() recursion when executing 'case'.
Peter Avalos [Sun, 25 Dec 2011 17:20:37 +0000 (09:20 -0800)]
sh: Reduce one level of evaltree() recursion when executing 'case'.

Free expanded case text before executing commands.
Remove impossible evalskip checks (expanding an argument cannot set
evalskip anymore since $(break) and the like are properly executed
in a subshell environment).

Obtained-from:  FreeBSD 228013

12 years agosh: Allow unsetting OPTIND.
Peter Avalos [Sun, 25 Dec 2011 17:16:48 +0000 (09:16 -0800)]
sh: Allow unsetting OPTIND.

Obtained-from:  FreeBSD 227773

12 years agosh: Remove undefined behaviour due to overflow in +/-/* in arithmetic.
Peter Avalos [Sun, 25 Dec 2011 17:13:22 +0000 (09:13 -0800)]
sh: Remove undefined behaviour due to overflow in +/-/* in arithmetic.

Obtained-from:  FreeBSD 227369

12 years agosh(1): Improve documentation of field splitting.
Peter Avalos [Sun, 25 Dec 2011 17:11:49 +0000 (09:11 -0800)]
sh(1): Improve documentation of field splitting.

Obtained-from:  FreeBSD 227122

12 years agoMerge branch 'master' of /home/www-data/gitweb/dragonfly
Peter Avalos [Sat, 24 Dec 2011 21:17:59 +0000 (13:17 -0800)]
Merge branch 'master' of /home/www-data/gitweb/dragonfly

12 years agopam_unix: Respect passwordtime from login.conf if set.
Peter Avalos [Sat, 24 Dec 2011 21:14:25 +0000 (13:14 -0800)]
pam_unix:  Respect passwordtime from login.conf if set.

Rewrap a lot of really short lines in pam_unix.8.

Note that pam_unix(8) does not respect PAM_CHANGE_EXPIRED_AUTHTOK.

Obtained-from:  FreeBSD

12 years agopam_ssh: Don't allow a bogus passphrase for unencrypted keys.
Peter Avalos [Sat, 24 Dec 2011 21:00:13 +0000 (13:00 -0800)]
pam_ssh:  Don't allow a bogus passphrase for unencrypted keys.

key_load_private() ignores the passphrase argument if the private key
is unencrypted.  This defeats the nullok check, because it means a
non-null passphrase will successfully unlock the key.

To address this, try at first to load the key without a passphrase.
If this succeeds and the user provided a non-empty passphrase *or*
nullok is false, reject the key.

While I'm here: Load the ECDSA key if there is one.

Obtained-from:  FreeBSD 227757, 219426, & 226101

12 years agoInclude lib/Makefile.inc in pam_modules' Makefile.inc.
Peter Avalos [Sat, 24 Dec 2011 20:53:42 +0000 (12:53 -0800)]
Include lib/Makefile.inc in pam_modules' Makefile.inc.

Otherwise, none of the modules will pick up what's in lib/Makefile.inc.

12 years agoGC pam_krb5 and pam_ksu.
Peter Avalos [Sat, 24 Dec 2011 20:24:52 +0000 (12:24 -0800)]
GC pam_krb5 and pam_ksu.

These haven't been built since 2009, and pam_krb5 is available in
pkgsrc if someone needs it.

12 years agopam_group: Add ruser and luser options.
Peter Avalos [Sat, 24 Dec 2011 20:15:58 +0000 (12:15 -0800)]
pam_group: Add ruser and luser options.

The former corresponds to the current behavior, where the module checks
that the supplicant is a member of the required group.  The latter
checks the target user instead.  If neither option was specified,
pam_group(8) assumes "ruser" and issues a warning.

Obtained-from:  FreeBSD 219563 & 219564

12 years agostyle(9) fix.
Peter Avalos [Sat, 24 Dec 2011 20:03:05 +0000 (12:03 -0800)]
style(9) fix.

12 years agoNFS server: Record bwrite() error in nfsrv_commit.
Venkatesh Srinivas [Sat, 24 Dec 2011 19:27:12 +0000 (11:27 -0800)]
NFS server: Record bwrite() error in nfsrv_commit.

12 years agoNFS server: Zero not-fully-initialized UIO structure.
Venkatesh Srinivas [Sat, 24 Dec 2011 18:26:17 +0000 (10:26 -0800)]
NFS server: Zero not-fully-initialized UIO structure.

From: OpenBSD nfs_serv.c 1.90

12 years agoNFS server: Import various fixes from FreeBSD.
Venkatesh Srinivas [Sat, 24 Dec 2011 18:16:53 +0000 (10:16 -0800)]
NFS server: Import various fixes from FreeBSD.

* Rev 228520: Honor NFSv3 commit call when count = 0. (delphij)

* Rev 228185: Enhance sequential access heuristic used for readahead
              and reuse it for writes as well.
        * Use a prime number for sequential detection table
        * Factor our sequential detection code
        * Ramp up sequential heurstic quickly based on IO size.

        This patch differs from the FreeBSD version in that we rapidly
        decay the sequential heuristic as in the original code and don't
        attempt to deal with reordered RPCs.

* Rev 159871: Size the NFS server dupreq cache on the basis of nmbclusters.
This patch differs from the FreeBSD version in that we don't
alter the desired cache size based on nmbcluster change events.

* Rev 116789: Bug in nfsrv_read() that caused the replies to certain NFSv3
short read operations at the end of a file to not have the "eof"
flag set. (iedowse)

12 years ago<sys/tbridge.h>: Add a __printflike().
Sascha Wildner [Sat, 24 Dec 2011 15:11:01 +0000 (16:11 +0100)]
<sys/tbridge.h>: Add a __printflike().

12 years agolibm: Fix a typo in MLINKS name.
Sascha Wildner [Sat, 24 Dec 2011 15:10:56 +0000 (16:10 +0100)]
libm: Fix a typo in MLINKS name.

12 years agoProperly dispose of page in sf_buf_mfree(), #2.
Venkatesh Srinivas [Sat, 24 Dec 2011 08:41:28 +0000 (00:41 -0800)]
Properly dispose of page in sf_buf_mfree(), #2.

sf_buf_mfree() had a wakeup before it attempted to free a page or wake it up
again. Neither are allowed, as the first wakeup unsets the page BUSY.
Follow on to commit 8c3e9928c907

Reported-by: lentferj
12 years agoAdd HAMMER2 vnode tag type.
Venkatesh Srinivas [Sat, 24 Dec 2011 07:12:36 +0000 (23:12 -0800)]
Add HAMMER2 vnode tag type.

12 years agolibpam: Update Makefile.
Peter Avalos [Sat, 24 Dec 2011 00:59:58 +0000 (16:59 -0800)]
libpam: Update Makefile.

This commit updates the Makefile so that it resembles the Makefiles
distributed by the vendor dist.  This will make updates a little easier.

No functional changes.

12 years agoMerge branch 'master' of /repository/git/dragonfly
Venkatesh Srinivas [Sat, 24 Dec 2011 00:32:56 +0000 (16:32 -0800)]
Merge branch 'master' of /repository/git/dragonfly

12 years agokernel: Factor out common parts of bufdamon and bufdaemon_hw.
Venkatesh Srinivas [Sat, 24 Dec 2011 00:31:07 +0000 (16:31 -0800)]
kernel: Factor out common parts of bufdamon and bufdaemon_hw.

Except for a few parameters, the core loops of bufdaemon and bufdaemon_hw were
identical. This commit has no functional change.

12 years agoRemove the script that was used to update the pciconf(8) database.
Sascha Wildner [Sat, 24 Dec 2011 00:11:38 +0000 (01:11 +0100)]
Remove the script that was used to update the pciconf(8) database.

12 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sat, 24 Dec 2011 00:10:23 +0000 (01:10 +0100)]
Update the pciconf(8) database.

Dec 21 snapshot from http://pciids.sourceforge.net/

This commit switches us to using the sourceforge list only. It's large,
actively maintained, and comes in the right format for pciconf(8) so we
need no scripts to prepare it.

Previously it was a combination of this database with Chris Hart's (seems
to be no longer actively maintained) and Jim Boemler's.

12 years agoUpdate build for OpenPAM Lycopsida.
Peter Avalos [Fri, 23 Dec 2011 23:46:46 +0000 (15:46 -0800)]
Update build for OpenPAM Lycopsida.

12 years agoMerge branch 'vendor/OPENPAM'
Peter Avalos [Fri, 23 Dec 2011 21:47:59 +0000 (13:47 -0800)]
Merge branch 'vendor/OPENPAM'

12 years agoImport OpenPAM Lycopsida.
Peter Avalos [Fri, 23 Dec 2011 21:28:41 +0000 (13:28 -0800)]
Import OpenPAM Lycopsida.

This also includes changeset 509 to prevent a logged error message if
the file doesn't exist in openpam_check_owner_perms.c.

12 years agotelnetd: Validate key length prior to copying into a fixed buffer.
Peter Avalos [Fri, 23 Dec 2011 18:16:31 +0000 (10:16 -0800)]
telnetd:  Validate key length prior to copying into a fixed buffer.

It's possible for a remote attacker to execute arbitrary code with the
privileges of the telnetd daemon (normally root) prior to this fix.
CVE-2011-4862

Obtained-from:   FreeBSD-SA-11:08.telnetd

12 years agostore.9: Add a line about suword32().
Sascha Wildner [Fri, 23 Dec 2011 14:51:00 +0000 (15:51 +0100)]
store.9: Add a line about suword32().

12 years agovkernel/vkernel64: Add suword32() to fix build.
Sascha Wildner [Fri, 23 Dec 2011 14:50:06 +0000 (15:50 +0100)]
vkernel/vkernel64: Add suword32() to fix build.

12 years agokernel/x86_64: Remove a useless file.
Sascha Wildner [Fri, 23 Dec 2011 13:51:47 +0000 (14:51 +0100)]
kernel/x86_64: Remove a useless file.

12 years agotbridge: Make it compilable into the kernel and add it to the LINTs.
Sascha Wildner [Fri, 23 Dec 2011 00:04:41 +0000 (01:04 +0100)]
tbridge: Make it compilable into the kernel and add it to the LINTs.

This is purely for build testing. It would never be compiled into a
normal kernel.

12 years agotbridge: Remove an unused header. It's all in <sys/tbridge.h>.
Sascha Wildner [Thu, 22 Dec 2011 23:53:42 +0000 (00:53 +0100)]
tbridge: Remove an unused header. It's all in <sys/tbridge.h>.

12 years agokernel: Remove two PC98 specific serial driver headers.
Sascha Wildner [Thu, 22 Dec 2011 23:31:45 +0000 (00:31 +0100)]
kernel: Remove two PC98 specific serial driver headers.

12 years agoboot: Remove some unused files in sys/boot.
Sascha Wildner [Thu, 22 Dec 2011 23:07:44 +0000 (00:07 +0100)]
boot: Remove some unused files in sys/boot.

12 years agokernel: Remove some more old headers.
Sascha Wildner [Thu, 22 Dec 2011 22:15:21 +0000 (23:15 +0100)]
kernel: Remove some more old headers.

They all got useless with the recent ISA-only driver removal.

12 years agoral(4): Remove an unused header.
Sascha Wildner [Thu, 22 Dec 2011 21:55:10 +0000 (22:55 +0100)]
ral(4): Remove an unused header.

No longer used since ral(4) was switched to modules for the firmware.

12 years agokernel - Fix new static stackgap feature from recent commit
Matthew Dillon [Thu, 22 Dec 2011 21:18:41 +0000 (13:18 -0800)]
kernel - Fix new static stackgap feature from recent commit

* Fix the code up a bit to make the feature actually work properly.

12 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 22 Dec 2011 21:18:37 +0000 (13:18 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

12 years agokernel: Remove an unused header file.
Sascha Wildner [Thu, 22 Dec 2011 21:17:02 +0000 (22:17 +0100)]
kernel: Remove an unused header file.

The two (PC98) drivers using this were removed in 2005.

12 years agokernel - cleanup bit number test
Matthew Dillon [Thu, 22 Dec 2011 19:48:34 +0000 (11:48 -0800)]
kernel - cleanup bit number test

* Use testq/%rax instead of %eax.  This change should have no real effect
  since the test is against a bit number and not a bit mask, but is more
  correct.

12 years agokernel - Reorder critical section interlock in splz()
Matthew Dillon [Thu, 22 Dec 2011 19:45:06 +0000 (11:45 -0800)]
kernel - Reorder critical section interlock in splz()

* Reorder a critical section interlock in splz() to remove a one-instruction
  window where an interrupt might nest against the splz() operation.

12 years agokernel - Properly dispose of vm_page_t in sf_buf_mfree()
Matthew Dillon [Thu, 22 Dec 2011 19:43:26 +0000 (11:43 -0800)]
kernel - Properly dispose of vm_page_t in sf_buf_mfree()

* Properly dispose of vm_page_t in sf_buf_mfree(), used by sendfile()

* Should fix a VM page delete/free panic.

Reported-by: sephe