dragonfly.git
3 years agokernel - Fix floating point save state structure and minor npx issues
Matthew Dillon [Thu, 22 Dec 2011 19:21:41 +0000 (11:21 -0800)]
kernel - Fix floating point save state structure and minor npx issues

* The floating point save structure(s) used by the kernel and possibly
  also userland were too large for x86-64 due to a porting error where
  'long' variables were left intact that should have been turned into
  32-bit variables.

  No known adverse effect to the too-large structures but we have to get
  it right.

* npxexit() was not being called in a kernel thread exit case.  Kernel
  threads do not use the FP unit so the case was never hit, but fix it
  anyway.

* Move a critical section to cover a flags test to handle a very rare
  preemptive thread switch issue.  Since the preempting thread is a
  kernel thread which does not use the FP unit this case was never hit,
  but fix it anyway.

3 years agolibc - fix mcontext issues
Matthew Dillon [Thu, 22 Dec 2011 19:13:45 +0000 (11:13 -0800)]
libc - fix mcontext issues

* Fix incorrect register use in _get_mcontext() left over from the
  32-bit port to 64-bits.

* This routine is only (currently) used by a few pkgsrc packages.

3 years agopci: Bring in HyperTransport MSI mapping support
Sepherosa Ziehau [Thu, 22 Dec 2011 11:52:02 +0000 (19:52 +0800)]
pci: Bring in HyperTransport MSI mapping support

3 years agoBump __DragonFly_version in param.h due to libm update
John Marino [Thu, 22 Dec 2011 07:19:05 +0000 (08:19 +0100)]
Bump __DragonFly_version in param.h due to libm update

3 years agolibm: Man page updates
John Marino [Wed, 21 Dec 2011 22:34:17 +0000 (23:34 +0100)]
libm: Man page updates

These are the man page updates required as a consequence
of adding FreeBSD functions to libm.

3 years agolibm: Sync with FreeBSD (~50 math functions added)
John Marino [Wed, 21 Dec 2011 17:10:04 +0000 (18:10 +0100)]
libm: Sync with FreeBSD (~50 math functions added)

The main purpose of syncing with FreeBSD is to obtain numerous "long double"
functions which are required for C99 compliance.  There are still many
functions missing.  According to g++ testsuite, the following 10 functions
still must be implemented at least:
        coshl           logl            expl
        sinhl           log2l           expm1l
        acoshl          log10l
        asinhl          log1pl

Also known missing are nexttowardl, tgammal, and the long double version of
most of several complex functions.

A few years ago the freebsd-based math library was thrown out in favor of
the NetBSD version.  It may be time to reverse that and sync the entire
libm with FreeBSD.  Right now the DragonFly libm is a mixture between the
two and it doesn't divide nicely.  All the rounding and rint functions from
NetBSD had to be thrown out as well as the "kernel" functions.  For the
short term this is okay, but in the long term it would be a good idea to
start tracking FreeBSD again.  They are maintaining this library more
frequently and adding more functions more rapidly than NetBSD, so it would
be good to piggy-back on that effort.

The man page will be committed separately.

3 years agolibm: Add .section .note.GNU-stack to all assembly files
John Marino [Tue, 20 Dec 2011 12:07:37 +0000 (13:07 +0100)]
libm: Add .section .note.GNU-stack to all assembly files

GCC always appends the following line to assembly files it generates:

  .section    .note.GNU-stack,"",@progbits

This creates an empty section named ".note.GNU-stack" to the object file
which servers as a hint to GNU linkers that this object file does not
require an executable stack.  When all linked object files indicate that
no executable stack is needed, the executable NX bit is set such as the
binary is run on a non-executable stack.  This is a free security
improvement against buffer overflow attacks.

3 years agolibm: Some cleanup in the manual pages.
Sascha Wildner [Wed, 21 Dec 2011 18:53:20 +0000 (19:53 +0100)]
libm: Some cleanup in the manual pages.

3 years agolibm: A little cleanup in the exp*(3) MLINKS.
Sascha Wildner [Wed, 21 Dec 2011 18:28:10 +0000 (19:28 +0100)]
libm: A little cleanup in the exp*(3) MLINKS.

3 years agoRemove some __STDC__ checks.
Sascha Wildner [Wed, 21 Dec 2011 18:05:43 +0000 (19:05 +0100)]
Remove some __STDC__ checks.

3 years agoaltq/cbq: Clear poll-cache if the cached class is to be destroyed
Sepherosa Ziehau [Wed, 21 Dec 2011 08:09:50 +0000 (16:09 +0800)]
altq/cbq: Clear poll-cache if the cached class is to be destroyed

3 years agoaltq/hfsc: Clear poll-cache if the cached hfsc class is to be destroyed
Sepherosa Ziehau [Wed, 21 Dec 2011 08:01:58 +0000 (16:01 +0800)]
altq/hfsc: Clear poll-cache if the cached hfsc class is to be destroyed

Reported-by: pavalos@
3 years agosmb - Tear out C++-wannabe exception magic
Samuel J. Greear [Tue, 20 Dec 2011 19:32:14 +0000 (12:32 -0700)]
smb - Tear out C++-wannabe exception magic

3 years agoi386/ioapic_abi: Mark the unused IOAPIC irqmap as reserved
Sepherosa Ziehau [Tue, 20 Dec 2011 11:47:23 +0000 (19:47 +0800)]
i386/ioapic_abi: Mark the unused IOAPIC irqmap as reserved

Since IDT on i386 is shared, we need to guard against reuse
an already used IDT entry

3 years agoRemove formatted version of ieee.3 manpage too.
Sascha Wildner [Tue, 20 Dec 2011 11:46:12 +0000 (12:46 +0100)]
Remove formatted version of ieee.3 manpage too.

3 years agolibm: Bump __DragonFly_version, remove obsolete man page
John Marino [Tue, 20 Dec 2011 10:12:55 +0000 (11:12 +0100)]
libm: Bump __DragonFly_version, remove obsolete man page

The ieee (3) man page is no longer generated, so add it to the upgrade
script. The last commit introduced several functions to libm, so that
merits increasing the param.h version.

3 years agolibm: Sync with NetBSD
John Marino [Mon, 19 Dec 2011 22:29:15 +0000 (23:29 +0100)]
libm: Sync with NetBSD

Adds the following assembly function: logbl, ilogbl, modf, scalbnl
Adds the following source functions: exp2, exp2f, frexp, nextafterl,
  nexttoward, requo, remquof, and fabsl
Captures all the bug fixes since last sync
Synchronizes with current NetBSD versions where possible.

Required to fix modern gcc/fortran and other packages.
Gets closer to C99 capability.

3 years agoloader.8: Add missing spaces.
Sascha Wildner [Tue, 20 Dec 2011 09:59:00 +0000 (10:59 +0100)]
loader.8: Add missing spaces.

3 years agoloader.conf.5: Use .Dx.
Sascha Wildner [Tue, 20 Dec 2011 09:58:52 +0000 (10:58 +0100)]
loader.conf.5: Use .Dx.

3 years agovinum(4): Remove some casts to union and solve it in standard C.
Sascha Wildner [Mon, 19 Dec 2011 18:09:03 +0000 (19:09 +0100)]
vinum(4): Remove some casts to union and solve it in standard C.

3 years agovpo(4): Remove some casts to union and solve it in standard C.
Sascha Wildner [Mon, 19 Dec 2011 18:03:05 +0000 (19:03 +0100)]
vpo(4): Remove some casts to union and solve it in standard C.

3 years agokernel: Shuffle some initialization around to avoid forward declarations.
Sascha Wildner [Mon, 19 Dec 2011 12:18:57 +0000 (13:18 +0100)]
kernel: Shuffle some initialization around to avoid forward declarations.

3 years agokernel: Remove now obsolete CPU_AMD64X2_INTR_SPAM option.
Sascha Wildner [Mon, 19 Dec 2011 12:05:35 +0000 (13:05 +0100)]
kernel: Remove now obsolete CPU_AMD64X2_INTR_SPAM option.

3 years agox86_64: Always set LINTEN for AMD CPUs if their family >= 0xF
Sepherosa Ziehau [Mon, 19 Dec 2011 11:54:10 +0000 (19:54 +0800)]
x86_64: Always set LINTEN for AMD CPUs if their family >= 0xF

This merges d54b8204947bb8a83fa3d2c7f1b595e47f3802c2

3 years agoi386: Always set LINTEN for AMD CPUs if their family >= 0xF
Sepherosa Ziehau [Mon, 19 Dec 2011 11:33:30 +0000 (19:33 +0800)]
i386: Always set LINTEN for AMD CPUs if their family >= 0xF

Since LINTEN will take effect when LAPIC is hardware enabled,
so we defer the LINTEN turning on when we know LAPIC will be
software enabled.

This fixes the recent MI per-cpu interrupt information array
support on AMD CPUs when IOAPIC is disabled on SMP system.

3 years agogpt(8): increase size of boot slice to 768MB
François Tigeot [Sun, 18 Dec 2011 19:48:19 +0000 (20:48 +0100)]
gpt(8): increase size of boot slice to 768MB

* aligning it to the size of the boot slice created by the
  live cd installer

3 years agoi386/MachintrABI: Use low-level INTR{EN,DIS} in intr_{setup,teardown}
Sepherosa Ziehau [Sun, 18 Dec 2011 13:53:17 +0000 (21:53 +0800)]
i386/MachintrABI: Use low-level INTR{EN,DIS} in intr_{setup,teardown}

This merges 26cf64b268c65144b898d5d00883a252da364c03

3 years agoi386/icu: Add intr_{enable,disable} wrapper for ICU_INTR{EN,DIS}
Sepherosa Ziehau [Sun, 18 Dec 2011 13:20:17 +0000 (21:20 +0800)]
i386/icu: Add intr_{enable,disable} wrapper for ICU_INTR{EN,DIS}

This merges 1967234a6fada57e929763ef261fcb5739102053

3 years agoi386/ioapic_abi: Augment intr_{setup,teardown} w/ assertions
Sepherosa Ziehau [Sun, 18 Dec 2011 12:09:31 +0000 (20:09 +0800)]
i386/ioapic_abi: Augment intr_{setup,teardown} w/ assertions

This merges 88100cf6c15096c1eb0776d2a8bd9dcf04d19095

3 years agoi386/ioapic_abi: Augment intr_disable/intr_enable w/ assertions
Sepherosa Ziehau [Sun, 18 Dec 2011 12:02:11 +0000 (20:02 +0800)]
i386/ioapic_abi: Augment intr_disable/intr_enable w/ assertions

This merges aef690c8e8f24bd1169780ebc7bade827fb3f370

3 years agox86_64: Per-cpu IDT
Sepherosa Ziehau [Sun, 18 Dec 2011 05:05:07 +0000 (13:05 +0800)]
x86_64: Per-cpu IDT

3 years agoioapic: Even for UP, we still should initialize irqmap properly
Sepherosa Ziehau [Sun, 18 Dec 2011 03:15:51 +0000 (11:15 +0800)]
ioapic: Even for UP, we still should initialize irqmap properly

Since we enable IOAPIC even for UP building

3 years agoidt: Remove no longer applied comment about NIDT
Sepherosa Ziehau [Sun, 18 Dec 2011 03:11:58 +0000 (11:11 +0800)]
idt: Remove no longer applied comment about NIDT

We should always use all of the available IDT entries

3 years agonexus/intr: Properly assert cpuid for interrupt resources
Sepherosa Ziehau [Sun, 18 Dec 2011 02:17:48 +0000 (10:17 +0800)]
nexus/intr: Properly assert cpuid for interrupt resources

Noticed-by: Nuno Antunes
3 years agosym(4): Remove excessive semicolons.
Sascha Wildner [Sat, 17 Dec 2011 14:53:51 +0000 (15:53 +0100)]
sym(4): Remove excessive semicolons.

They are provided by the macro definition.

This is the same what FreeBSD did in r118472.

3 years agotwe(4): Remove a cast to a union (which is a GNU extension).
Sascha Wildner [Sat, 17 Dec 2011 14:04:09 +0000 (15:04 +0100)]
twe(4): Remove a cast to a union (which is a GNU extension).

3 years agovinum(4): Fix wrong parenthesizing.
Sascha Wildner [Fri, 16 Dec 2011 19:51:30 +0000 (20:51 +0100)]
vinum(4): Fix wrong parenthesizing.

3 years agopcn(4): Fix a bug where && was meant but & was used.
Sascha Wildner [Fri, 16 Dec 2011 13:50:23 +0000 (14:50 +0100)]
pcn(4): Fix a bug where && was meant but & was used.

3 years agomemcontrol(8): Fix wrong parenthesizing.
Sascha Wildner [Fri, 16 Dec 2011 13:18:11 +0000 (14:18 +0100)]
memcontrol(8): Fix wrong parenthesizing.

3 years agox86_64/MachintrABI: Use low-level INTR{EN,DIS} in intr_{setup,teardown}
Sepherosa Ziehau [Fri, 16 Dec 2011 09:20:00 +0000 (17:20 +0800)]
x86_64/MachintrABI: Use low-level INTR{EN,DIS} in intr_{setup,teardown}

intr_{setup,teardown} have already done enough verification for the
'intr' parameter

3 years agox86_64/icu: Add intr_{enable,disable} wrapper for ICU_INTR{EN,DIS}
Sepherosa Ziehau [Fri, 16 Dec 2011 08:52:38 +0000 (16:52 +0800)]
x86_64/icu: Add intr_{enable,disable} wrapper for ICU_INTR{EN,DIS}

- Add more assertion in icu_abi_intr_{enable,disable}()
- Augment icu_abi_intr_{setup,teardown}() w/ assertions

3 years agox86_64/ioapic_abi: Augment intr_{setup,teardown} w/ assertions
Sepherosa Ziehau [Fri, 16 Dec 2011 08:01:05 +0000 (16:01 +0800)]
x86_64/ioapic_abi: Augment intr_{setup,teardown} w/ assertions

3 years agox86_64/ioapic_abi: Augment intr_disable/intr_enable w/ assertions
Sepherosa Ziehau [Fri, 16 Dec 2011 07:21:44 +0000 (15:21 +0800)]
x86_64/ioapic_abi: Augment intr_disable/intr_enable w/ assertions

3 years agonexus_alloc_resource: Add missing rman_set_rid()
Sepherosa Ziehau [Fri, 16 Dec 2011 06:09:16 +0000 (14:09 +0800)]
nexus_alloc_resource: Add missing rman_set_rid()

3 years agonexus/intr: Change the wrong cpuid backtrace to assertion
Sepherosa Ziehau [Fri, 16 Dec 2011 03:08:03 +0000 (11:08 +0800)]
nexus/intr: Change the wrong cpuid backtrace to assertion

3 years agotip(1): Remove "register".
Sascha Wildner [Fri, 16 Dec 2011 04:30:51 +0000 (05:30 +0100)]
tip(1): Remove "register".

3 years agoVFS accounting: add a sync command
Francois Tigeot [Thu, 1 Dec 2011 12:43:23 +0000 (13:43 +0100)]
VFS accounting: add a sync command

* Kernel usage counter are not stored permanently on the filesystem,
  they need to be properly initialized from userland to return
  meaningful values

3 years agovquota(8): add a -h flag
Francois Tigeot [Sun, 27 Nov 2011 10:41:08 +0000 (11:41 +0100)]
vquota(8): add a -h flag

* humanize numbers where it makes sense

3 years agoAdd a NO_BINUTILS221 option (like NO_GCC41) to not build older binutils.
Sascha Wildner [Thu, 15 Dec 2011 09:57:57 +0000 (10:57 +0100)]
Add a NO_BINUTILS221 option (like NO_GCC41) to not build older binutils.

Reported-by: ftigeot
3 years agovquota(8): More style fixes.
Sascha Wildner [Thu, 15 Dec 2011 09:42:03 +0000 (10:42 +0100)]
vquota(8): More style fixes.

3 years agointr: Per-cpu MI interrupt information array
Sepherosa Ziehau [Thu, 15 Dec 2011 05:47:26 +0000 (13:47 +0800)]
intr: Per-cpu MI interrupt information array

- Interrupt information is only recorded in its target CPU's interrupt
  information array.
- Interrupt threads, emergency polling threads, interrupt livelock
  processing and hardware interrupt threads scheduling only access
  the interrupt information of the CPU they are running on; they have
  already been locked to the interrupt's target CPU.
- Location of SWI information is saved in a global array swi_info_ary,
  since scheduling SWI does not necessarily happens on the CPU that
  SWI thread is running, we need a quick and correct way find the SWI
  information.
- Factor out sched_ithd_intern, which accept interrupt information
  (struct intr_info) instead of interrupt number.  Split the original
  sched_ithd() into sched_ithd_soft(), which schedules SWI thread, and
  sched_ithd_hard() which schedules hardware interrupt thread.
- vmstat(8) interrupt reporting w/ -v is augmented to print the interrupts'
  target CPU.

This paves way to the per-cpu MD interrupt description table

3 years agokernel - Update loader.conf documentation and add sio comconsole unit specifier
Matthew Dillon [Thu, 15 Dec 2011 01:12:51 +0000 (17:12 -0800)]
kernel - Update loader.conf documentation and add sio comconsole unit specifier

* Update the loader.conf documentation to describe how the boot loader and
  kernel can use a serial port and baud rate other than the default for
  comconsole.

  Also describe how to recompile the boot loader.

  Describe how IPMI can be tied into the boot loader and kernel via
  the built-in fake serial port in the BMC (often COM2).

* Add a kenv feature to allow the sioN.flags to be specified in loader.conf.
  This allows the comconsole to be moved to e.g. sio1 without having
  to recompile the kernel.

3 years agovquota(8): finish implementing the check command
Francois Tigeot [Mon, 10 Oct 2011 20:08:08 +0000 (22:08 +0200)]
vquota(8): finish implementing the check command

* collect the sums of file sizes for each used uid and gid
  and display them

3 years agovquota(8): add code to manage hard links
Francois Tigeot [Sun, 25 Sep 2011 20:40:27 +0000 (22:40 +0200)]
vquota(8): add code to manage hard links

* Add an inode number caching infrastructure to only count file size
  once for files with more than one hard link.

* The new code is used by the vquota check command

3 years agoahci(4): Add MODULE_VERSION.
Sascha Wildner [Wed, 14 Dec 2011 19:21:42 +0000 (20:21 +0100)]
ahci(4): Add MODULE_VERSION.

3 years agokernel/vfs_quota: Fix the placement of braces.
Sascha Wildner [Wed, 14 Dec 2011 13:32:45 +0000 (14:32 +0100)]
kernel/vfs_quota: Fix the placement of braces.

3 years agoNULL VFS: store PFS mount points for later use
Francois Tigeot [Wed, 24 Aug 2011 20:00:28 +0000 (22:00 +0200)]
NULL VFS: store PFS mount points for later use

* This is a hack to obtain the pfs mount point in vop_write()

* PFSes use nullfs mounts. Unfortunately, the nullfs implementation
  does not respect the traditional vfs/vnode layers and its vnodes
  may belong to many mount point at once.

* What's worse, the mount point passed to VFS functions is the one
  of the underlying non-PFS filesystem.

* We use the namecache layer to put the upper mount point of the
  PFS in a new vnode field to work around this limitation.

3 years agoUse a sysctl to show if VFS accounting is enabled
François Tigeot [Wed, 14 Dec 2011 13:11:25 +0000 (14:11 +0100)]
Use a sysctl to show if VFS accounting is enabled

* Both the loader tunable and the sysctl are now called
  vfs.accounting_enabled

3 years agoDisable VFS accounting by default
François Tigeot [Wed, 14 Dec 2011 09:53:46 +0000 (10:53 +0100)]
Disable VFS accounting by default

* Enable it globally with vfs.accounting.enable="1" in loader.conf

3 years agoFix some overlooked references in manual pages (malloc(9) -> kmalloc(9)).
Sascha Wildner [Wed, 14 Dec 2011 11:03:16 +0000 (12:03 +0100)]
Fix some overlooked references in manual pages (malloc(9) -> kmalloc(9)).

3 years agolibprop: Fix some references in the manual pages (malloc(9) -> kmalloc(9)).
Sascha Wildner [Wed, 14 Dec 2011 10:38:20 +0000 (11:38 +0100)]
libprop: Fix some references in the manual pages (malloc(9) -> kmalloc(9)).

3 years agointr: Per-CPU emergency thread
Sepherosa Ziehau [Wed, 14 Dec 2011 09:51:46 +0000 (17:51 +0800)]
intr: Per-CPU emergency thread

3 years agointr: Remove the broken sysctl_intrcnt(); use sysctl_intrcnt_all() instead
Sepherosa Ziehau [Wed, 14 Dec 2011 08:59:50 +0000 (16:59 +0800)]
intr: Remove the broken sysctl_intrcnt(); use sysctl_intrcnt_all() instead

3 years agointr: Nuke count_registered_ints()
Sepherosa Ziehau [Wed, 14 Dec 2011 08:20:41 +0000 (16:20 +0800)]
intr: Nuke count_registered_ints()

The only caller of this function icu_reinit() actually was broken
for a logn time; it needs to be reworked

3 years agointr: Remove unused function
Sepherosa Ziehau [Wed, 14 Dec 2011 08:10:45 +0000 (16:10 +0800)]
intr: Remove unused function

3 years agomake - Do not try to track stopped/continued processes
Matthew Dillon [Wed, 14 Dec 2011 03:40:06 +0000 (19:40 -0800)]
make - Do not try to track stopped/continued processes

* There are bugs in make which I haven't tracked down related to the
  handling of stopped/continued processes.

* Work around the problem by removing the use of WUNTRACED in one of the
  several waitpid() use cases.  It is unclear why one would ever want to
  try to track signals to processes for this case.

* This fixes a "couldn't resume %s" error from make when a large -j N
  build is repeatedly ^Z'd and continued.

3 years agokernel - Fix signal races against exiting processes
Matthew Dillon [Wed, 14 Dec 2011 03:37:04 +0000 (19:37 -0800)]
kernel - Fix signal races against exiting processes

* Fix a panic which can occur when a signal races an exiting process.

* Fix an incorrect status return from the wait*() system calls which
  can sometimes occur when a SIGTSTP or other signal races an exit.

  Do not allow the signal status to overwrite the exit value.

* Fix a race where the kill() system call can return ESRCH when a signal
  races an exiting process which has already entered the zombie state.

  Return success in this case and silently drop the signal.

3 years agoFix wrong argument to allproc_scan in elf_brand_inuse()
YONETANI Tomokazu [Tue, 13 Dec 2011 21:44:37 +0000 (06:44 +0900)]
Fix wrong argument to allproc_scan in elf_brand_inuse()

the callback expects data to be the address of elf_brand_inuse_info
but the caller passed something else.  this fixes kernel panic upon
`kldunload linux'.

3 years agoVFS accounting: add a new vquotactl() syscall
Francois Tigeot [Tue, 16 Aug 2011 10:01:27 +0000 (12:01 +0200)]
VFS accounting: add a new vquotactl() syscall

* It uses a proplib(3) based interface to pass messages between
  kernel and userland

* It may be used to handle different commands in the future

* For now, only implement one displaying the contents of the
  space counters for a particular mount point

* Also add a debug flag to vquota(8) showing messages exchanged
  between kernel and userland

3 years agoecc(4): Move from sys/dev/bridge to sys/dev/misc.
Sascha Wildner [Tue, 13 Dec 2011 17:17:31 +0000 (18:17 +0100)]
ecc(4): Move from sys/dev/bridge to sys/dev/misc.

While here, make it compilable into the kernel and add it to the LINTs.

3 years agoecc.4: Update manual page for X3400 support.
Sascha Wildner [Tue, 13 Dec 2011 14:51:51 +0000 (15:51 +0100)]
ecc.4: Update manual page for X3400 support.

3 years ago<sys/elf_common.h>: Add an EM_ALPHA #define.
Sascha Wildner [Tue, 13 Dec 2011 13:40:40 +0000 (14:40 +0100)]
<sys/elf_common.h>: Add an EM_ALPHA #define.

It seems to help with building openjdk.

The value the same in binutils too.

Taken-from: FreeBSD
Reported-by: dfcat on #dragonflybsd
3 years agoi386/ioapic: Always allow user to specify GSI's target CPU
Sepherosa Ziehau [Tue, 13 Dec 2011 13:34:45 +0000 (21:34 +0800)]
i386/ioapic: Always allow user to specify GSI's target CPU

This merges b8dfb6b1be7001e8dc00e5bc9e6efb85a5e0f4ab

3 years agoi386/icu: Implement rman_setup MachIntrABI method
Sepherosa Ziehau [Tue, 13 Dec 2011 13:28:41 +0000 (21:28 +0800)]
i386/icu: Implement rman_setup MachIntrABI method

This merges b3cf468e65fcb31e33ab367c068eee119db92491

3 years agoi386/ioapic_abi: Implement MachIntrABI.rman_setup
Sepherosa Ziehau [Tue, 13 Dec 2011 12:15:33 +0000 (20:15 +0800)]
i386/ioapic_abi: Implement MachIntrABI.rman_setup

This merges 981239a7fd1d95a113e7526e3bef62975ff0f114

3 years agoecc: ecc: Support the ECC error detection for Xeon X3400 family
Sepherosa Ziehau [Tue, 13 Dec 2011 10:06:56 +0000 (18:06 +0800)]
ecc: ecc: Support the ECC error detection for Xeon X3400 family

3 years agoioapic/x86_64: Fix x86_64 buildkernel with gcc41 (syncs with i386).
Sascha Wildner [Tue, 13 Dec 2011 09:44:35 +0000 (10:44 +0100)]
ioapic/x86_64: Fix x86_64 buildkernel with gcc41 (syncs with i386).

In-discussion-with: sephe

3 years agoecc.4: Sync with current developments.
Sascha Wildner [Tue, 13 Dec 2011 09:31:26 +0000 (10:31 +0100)]
ecc.4: Sync with current developments.

3 years agoUFS VFS: initialize f_mntonname for the root mp
Francois Tigeot [Sat, 10 Dec 2011 18:24:00 +0000 (19:24 +0100)]
UFS VFS: initialize f_mntonname for the root mp

Taken from: OpenBSD

3 years agoHAMMER VFS: record the name of the mount directory
Francois Tigeot [Mon, 15 Aug 2011 12:42:23 +0000 (14:42 +0200)]
HAMMER VFS: record the name of the mount directory

* It has to be set at mount time in mp->mnt_stat.f_mntonname.

* Contrary to most filesystems, Hammer didn't do it.

* The new code was taken from ffs_mount() and OpenBSD's vfs_rootmountalloc()

3 years agoecc: Support the ECC error detection for Xeon E3-1200 family
Sepherosa Ziehau [Thu, 8 Dec 2011 09:02:36 +0000 (17:02 +0800)]
ecc: Support the ECC error detection for Xeon E3-1200 family

- ecc no longer replaces hostb, instead, it becomes a device under hostb
- Clean up the code a little bit
- Split ecc.c into individual files based on device type

3 years agobitops: Add __BIT64 and __BITS64
Sepherosa Ziehau [Tue, 13 Dec 2011 01:44:05 +0000 (09:44 +0800)]
bitops: Add __BIT64 and __BITS64

3 years agotcp: Fix the long standing negative offset panic on output path
Sepherosa Ziehau [Mon, 12 Dec 2011 07:28:04 +0000 (15:28 +0800)]
tcp: Fix the long standing negative offset panic on output path

This problem shows itself as:
- so_snd is empty
- snd_nxt is less than snd_una, thus stack variable 'off' will be
  negative and stack 'len' variable calculated from 'off' could
  be positive.
- The later on m_copydata() at 'send' label hit the panic, since
  the 'off' passed in is negative

i.e. The panic is triggered by wrong snd_nxt and snd_una

After analysing the coredump, if following things happened, snd_nxt
would be less than snd_una when tcp_output was entered:
1) The SYN was sent to the network.  (snd_nxt=iss+1, snd_una=iss)
2) The retransmit timeout happened for the SYN we had sent, however,
   the MGETHDR on the tcp_output path failed.  (snd_nxt=iss, snd_una=iss)
3) Later on the SYN|ACK for the SYN sent in step 1) came, before
   tcp_output, snd_una=iss+1, while snd_nxt=iss, thus snd_nxt<snd_una

To fix the panic, we just perform all of the state updates as if
MGETHDR was successful in step 2), so snd_nxt could be properly
updated (snd_nxt=iss+1)

Reported-by: pavalos@
3 years agoRevert "i386/files: isa/clock.c is clean enough to compile w/ -Werror"
Sascha Wildner [Mon, 12 Dec 2011 21:36:51 +0000 (22:36 +0100)]
Revert "i386/files: isa/clock.c is clean enough to compile w/ -Werror"

This reverts commit 1c00e39a16e32d0f4bdd2ccbea78281b0dafa926.

This breaks gcc41 buildkernel.

3 years agoVFS accounting: start collecting data
Francois Tigeot [Sun, 7 Aug 2011 17:29:38 +0000 (19:29 +0200)]
VFS accounting: start collecting data

* Add calls to the vfs accounting function in the different places
  where files may grow/diminish in size or change owners

* use the namecache layer mount point information in preference to
  the vnode one

3 years agomkinitrd.8: Create a mkinitrd.conf.5 link.
Sascha Wildner [Mon, 12 Dec 2011 18:45:41 +0000 (19:45 +0100)]
mkinitrd.8: Create a mkinitrd.conf.5 link.

3 years agomkinitrd(8): Move the defaults to /etc/defaults/mkinitrd.conf.
Sascha Wildner [Mon, 12 Dec 2011 18:40:37 +0000 (19:40 +0100)]
mkinitrd(8): Move the defaults to /etc/defaults/mkinitrd.conf.

Provide this file by default and if the user has to change anything,
they can use /etc/mkinitrd.conf, just like for rc.conf, etc.

While here, change -e to -r for the test of /etc/mkinitrd.conf's
existence.

3 years agoRevert "x86_64: isa/clock.c is clean enough to enable -Werror"
Sascha Wildner [Mon, 12 Dec 2011 18:16:11 +0000 (19:16 +0100)]
Revert "x86_64: isa/clock.c is clean enough to enable -Werror"

This reverts commit f2c6c11c130f9aaf10429503f3111c333e0253f1.

It breaks gcc41 buildkernel.

3 years agobsd.kern.mk: -Wold-style-declaration is unknown to gcc41.
Sascha Wildner [Mon, 12 Dec 2011 18:11:48 +0000 (19:11 +0100)]
bsd.kern.mk: -Wold-style-declaration is unknown to gcc41.

3 years agondis_events(8): Handle the "no event matched" case (fixes a gcc41 warning).
Sascha Wildner [Mon, 12 Dec 2011 18:11:01 +0000 (19:11 +0100)]
ndis_events(8): Handle the "no event matched" case (fixes a gcc41 warning).

3 years agokernel - Misc fixes and debugging
Matthew Dillon [Mon, 12 Dec 2011 17:37:20 +0000 (09:37 -0800)]
kernel - Misc fixes and debugging

* Add required CLDs in the exception paths.  The interrupt paths already
  CLD in PUSH_FRAME.

* Note that the fast_syscall (SYSENTER) path has an implied CLD due to the
  hardware mask applied to rflags.

* Add the IOPL bits to the set of bits set to 0 during a fast_syscall.

* When creating a dummy interrupt frame we don't have to push the
  actual %cs.  Just push $0 so the frame isn't misinterpreted as coming
  from userland.

* Additional debug verbosity for freeze_on_seg_fault.

* Reserve two void * fields for LWP debugging (for a later commit)

3 years agoKernel - Fix double-unlock in nlookupdotdot
Matthew Dillon [Mon, 12 Dec 2011 17:24:38 +0000 (09:24 -0800)]
Kernel - Fix double-unlock in nlookupdotdot

* Fix double-unlock assertion in the compat nlookupdotdot code

* This code is basically only triggered when a machine is acting as a NFS
  server when serving out a UFS mount (since HAMMER has its own).  Only
  NFS servers can access directories not connected through to the root
  via the namecache hierarchy and those are the only situations where
  nlookupdotdot is actually used.  ".." is normally handled directly by
  the namecache.

3 years agokernel - Dynamically size lwkt_cache_threads free cache
Matthew Dillon [Mon, 12 Dec 2011 17:22:43 +0000 (09:22 -0800)]
kernel - Dynamically size lwkt_cache_threads free cache

* Change the default # of free LWKT threads from 32 to 4*ncpus, with
  a minimum of 32.

* Improves performance on systems with more than 8 cores.

* NULL-out some fields on thread free as a safety.

3 years agoMerge git://git.dragonflybsd.org/dragonfly
Venkatesh Srinivas [Mon, 12 Dec 2011 01:21:35 +0000 (17:21 -0800)]
Merge git://git.dragonflybsd.org/dragonfly

3 years agoVFS accounting: list enabled filesystems
Francois Tigeot [Sun, 14 Aug 2011 15:24:55 +0000 (17:24 +0200)]
VFS accounting: list enabled filesystems

Use a new flag, MNT_ACCOUNTING for that

3 years agokernel/vfs_quota: Put the 'accounting enabled' message under bootverbose.
Sascha Wildner [Sun, 11 Dec 2011 15:51:47 +0000 (16:51 +0100)]
kernel/vfs_quota: Put the 'accounting enabled' message under bootverbose.

3 years agoi386/ioapic_abi: Disable interrupt load balance by default
Sepherosa Ziehau [Sun, 11 Dec 2011 13:48:15 +0000 (21:48 +0800)]
i386/ioapic_abi: Disable interrupt load balance by default

This merges 2b195d6a566cb8441f5d6d66363235683bbd92af

3 years agoi386/ioapic_abi: Per-cpu irqmap array
Sepherosa Ziehau [Sun, 11 Dec 2011 13:36:03 +0000 (21:36 +0800)]
i386/ioapic_abi: Per-cpu irqmap array

This merges 6f072945c912b376b55e396d8b81918c3cbd25c6

3 years agoi386/MachIntrABI: Remove unnecessary setidt in intr_setup/teardown
Sepherosa Ziehau [Sun, 11 Dec 2011 11:49:10 +0000 (19:49 +0800)]
i386/MachIntrABI: Remove unnecessary setidt in intr_setup/teardown

This merges c7d947d54787629833f1dd46789543ac77c3d7e1

3 years agoi386/ioapic: Add missing imen_lock/unlock
Sepherosa Ziehau [Sun, 11 Dec 2011 11:41:11 +0000 (19:41 +0800)]
i386/ioapic: Add missing imen_lock/unlock

This merges b551073687d461dc8b9e6d3a34dd285de40a26a6