Matthew Dillon [Fri, 10 Jun 2011 07:32:22 +0000 (00:32 -0700)]
kernel - Fix MP races in recent vm_object work
* lwkt_token_swap() needs a critical section to ensure that an interrupt
does not catch it mid-swap.
* Adjust vm_object_terminate() and vm_object_vnterminate() mechanics to
require that the object be locked and to eat the lock.
* Use vm_object_hold/drop in vm_map_copy_entry() (object must be locked
upon call to vm_object_collapse()).
* Acquire object locks in various places and swap the token order as
needed to chain locks in various loops.
* Shift some code around in vm_object.c
Matthew Dillon [Thu, 9 Jun 2011 20:34:10 +0000 (13:34 -0700)]
kernel - make vm_add_new_page() static
* Make vm_add_new_page() a static function
Matthew Dillon [Thu, 9 Jun 2011 20:28:08 +0000 (13:28 -0700)]
kernel - Fix a 'vm_page_unhold: hold count < 0' panic in kern_execve()
* imgp->firstpage is preloaded with lwbuf storage but we failed to NULL
it out on error, causing the code to later attempt to release a bogus
lwbuf.
* Fixes a hold count panic on random vm_page's.
Venkatesh Srinivas [Thu, 9 Jun 2011 19:41:41 +0000 (12:41 -0700)]
kernel -- vm: Mark vm_contig_pg_free and vm_contig_pg_kmap static.
Venkatesh Srinivas [Thu, 9 Jun 2011 15:34:23 +0000 (08:34 -0700)]
Document lwkt_token_swap in token(9).
Venkatesh Srinivas [Thu, 9 Jun 2011 15:31:00 +0000 (08:31 -0700)]
kernel -- Implement lwkt_token_swap; swaps most recent tokens in tokref stack.
Venkatesh Srinivas [Thu, 9 Jun 2011 15:11:34 +0000 (08:11 -0700)]
kernel -- Remove vestigial token flags field.
Sepherosa Ziehau [Thu, 9 Jun 2011 09:35:33 +0000 (17:35 +0800)]
x86_64/ioapic: Staticize ioapic_config()
Sepherosa Ziehau [Thu, 9 Jun 2011 09:29:22 +0000 (17:29 +0800)]
x86_64/ioapic: Cleanup header inclusion
Sepherosa Ziehau [Thu, 9 Jun 2011 07:31:27 +0000 (15:31 +0800)]
i386/mptable: Always dump MPTABLE PCI interrupt routing information
Sepherosa Ziehau [Thu, 9 Jun 2011 07:06:24 +0000 (15:06 +0800)]
i386/lapic: lapic_map() should take vm_paddr_t instead of vm_offset_t
Sepherosa Ziehau [Thu, 9 Jun 2011 06:49:24 +0000 (14:49 +0800)]
i386/madt: Cleanup interrupt source override processing
Sepherosa Ziehau [Thu, 9 Jun 2011 06:36:10 +0000 (14:36 +0800)]
i386/acpi: Remove unnecessary headers
Sepherosa Ziehau [Thu, 9 Jun 2011 06:28:09 +0000 (14:28 +0800)]
i386/lapic: Include <machine/smp.h> for smp_active_mask
Samuel J. Greear [Thu, 9 Jun 2011 07:34:27 +0000 (01:34 -0600)]
kernel - Allow signal delivery via KQ even if the process SIG_IGN's the signal
Reported-by: swildner@
Venkatesh Srinivas [Thu, 9 Jun 2011 02:06:38 +0000 (19:06 -0700)]
Move in6_addr's s6_addr16 and s6_addr32 definitions to __BSD_VISIBLE.
Sepherosa Ziehau [Wed, 8 Jun 2011 08:42:02 +0000 (16:42 +0800)]
x86_64/mptable: Always dump MPTABLE PCI interrupt routing information
Sepherosa Ziehau [Wed, 8 Jun 2011 08:28:26 +0000 (16:28 +0800)]
x86_64/lapic: lapic_map() should take vm_paddr_t instead of vm_offset_t
Sepherosa Ziehau [Wed, 8 Jun 2011 06:59:00 +0000 (14:59 +0800)]
x86_64/madt: Cleanup interrupt source override processing
Sepherosa Ziehau [Wed, 8 Jun 2011 06:26:50 +0000 (14:26 +0800)]
x86_64/acpi: Remove unnecessary headers
Sepherosa Ziehau [Wed, 8 Jun 2011 06:26:13 +0000 (14:26 +0800)]
x86_64/lapic: Include <machine/smp.h> for smp_active_mask
Matthew Dillon [Wed, 8 Jun 2011 02:09:32 +0000 (19:09 -0700)]
world - Fix buildworld after ifnet changes
* Use the _KERNEL_STRUCTURES mechanic to conditionalize struct ifnet
and related structures needed by buildworld.
Reported-by: matthiasr
Matthew Dillon [Tue, 7 Jun 2011 20:50:40 +0000 (13:50 -0700)]
kernel - Serialize ifioctl() with a mutex
* ifioctl() calls (aka via ifconfig) make various assumptions about the
stability of certain data structures and can panic otherwise. Concurrent
calls to ifioctl via ifconfig can create inconsistencies in the ifnet
structure.
* Rearrange the ifioctl() code into a fall-through modem, add a struct mtx
to the ifnet structure, and acquire and release the mutex in ifioctl()
to enforce stability relative to concurrent ifconfig/ioctl commands
issued on the interface.
* Fixes a panic reproduced via a while(1):
while (1)
echo -n x
ifconfig re0 inet6 fe80::201:2eff:fe31:5469%re0 &
ifconfig re0 inet6 fe80::201:2eff:fe31:5469%re0 delete &
sleep 0.1
end
* May fix other related panics.
NOTE: This mutex does not protect internal data structures related to
network operation. It is currently being used strictly to serialize
ifconfig style operations on the interface.
Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
Sascha Wildner [Tue, 7 Jun 2011 20:28:37 +0000 (22:28 +0200)]
<vm/vm_object.h>: Some little style cleanup.
Venkatesh Srinivas [Tue, 7 Jun 2011 20:13:34 +0000 (13:13 -0700)]
kernel -- vm_object locking: Interlock vm_object work in vm_fault.c
and vm_map.c with per-object token. Handle NULL objects for _hold and _drop.
Sepherosa Ziehau [Mon, 6 Jun 2011 11:38:24 +0000 (19:38 +0800)]
i386: Allow UP kernel to use LAPIC timer and I/O APIC
Sepherosa Ziehau [Mon, 6 Jun 2011 10:18:45 +0000 (18:18 +0800)]
i386: Remove unnecessary #ifdef SMP from files compiled with options SMP
YONETANI Tomokazu [Mon, 6 Jun 2011 05:09:04 +0000 (14:09 +0900)]
kernel: Add a final p_lock wait loop before kfree'ing the process
Since p_lock can be acquired during the process removal, there
needs to be a final wait loop after the proc has been removed
from all queues, just before the kfree(p). It will be a very
rare case but it definitely can still occur if e.g. the SYSCTL_OUT
code blocks on a VM fault or something like that.
Requested-by: dillon@
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1996>
Sepherosa Ziehau [Sat, 4 Jun 2011 13:29:32 +0000 (21:29 +0800)]
i386: Split mp_enable() into multiple SYSINITs
Sepherosa Ziehau [Sat, 4 Jun 2011 12:00:43 +0000 (20:00 +0800)]
i386: Split cpu_startup() into pic_finish() and cpu_finish()
Sepherosa Ziehau [Sat, 4 Jun 2011 11:47:24 +0000 (19:47 +0800)]
i386: Prepare mp_enable() for multi-stage procedure segmentation
Sepherosa Ziehau [Thu, 2 Jun 2011 12:10:41 +0000 (20:10 +0800)]
i386: Move base_memory from mp_machdep.c to machdep.c
Sascha Wildner [Fri, 3 Jun 2011 12:42:50 +0000 (14:42 +0200)]
coretemp(4): Sync with FreeBSD.
Sascha Wildner [Fri, 3 Jun 2011 12:42:25 +0000 (14:42 +0200)]
kernel: Add rdmsr_safe() in preparation for the coretemp(4) update.
Sepherosa Ziehau [Fri, 3 Jun 2011 09:10:10 +0000 (17:10 +0800)]
x86_64: Allow UP kernel to use LAPIC timer and I/O APIC
Sepherosa Ziehau [Fri, 3 Jun 2011 06:58:54 +0000 (14:58 +0800)]
x86_64: Remove unnecessary #ifdef SMP from files compiled with options SMP
Sepherosa Ziehau [Fri, 3 Jun 2011 06:42:16 +0000 (14:42 +0800)]
x86_64: Split mp_enable() into multiple SYSINITs
Each SYSINIT is put into the proper file. Garbage collect mp_start()
and mp_enable().
Venkatesh Srinivas [Fri, 3 Jun 2011 08:24:11 +0000 (01:24 -0700)]
kernel -- snp: Correct bug in snpfilter_detach().
Signed-off-by: Nathaniel Filardo <nwfilardo@gmail.com>
Submitted-by: Nick Prokharau <nickprok@gmail.com>
Sascha Wildner [Thu, 2 Jun 2011 18:36:13 +0000 (20:36 +0200)]
mandoc(1): Bump version.
Sascha Wildner [Thu, 2 Jun 2011 18:33:01 +0000 (20:33 +0200)]
Merge branch 'vendor/MDOCML'
Sascha Wildner [Thu, 2 Jun 2011 18:31:59 +0000 (20:31 +0200)]
Import mdocml-1.11.3
Sascha Wildner [Thu, 2 Jun 2011 15:52:46 +0000 (17:52 +0200)]
Fix the VKERNEL build.
Reported-by: Thomas Nikolajsen
Sascha Wildner [Thu, 2 Jun 2011 08:37:58 +0000 (10:37 +0200)]
Add manpages for mkcsmapper(1) and mkesdb(1) (taken from FreeBSD).
Sascha Wildner [Thu, 2 Jun 2011 06:20:01 +0000 (08:20 +0200)]
kernel/x86_64: Rename some macros to allow easier i386/x86_64 code sharing.
YONETANI Tomokazu [Thu, 2 Jun 2011 05:17:46 +0000 (14:17 +0900)]
kernel: Remove an extra p_lock == 0 check
proc_remove_zombie() waits for p_lock to drop to zero before removing
the process off zombproc, so this assertion is not needed (any more).
YONETANI Tomokazu [Thu, 2 Jun 2011 05:17:39 +0000 (14:17 +0900)]
Revert "kernel: Don't disturb about-to-be reaped zombies."
p_nthreads == 0 just means that the process's threads have all exited,
but not necessarily means it's about to be reaped. We still want it
to show up in the ps or top in case it gets stuck during the exit.
Pointed-out-by: dillon@
This reverts commit
9458c398c0b97d30032a6541f8ab452cd93f5a86.
Sepherosa Ziehau [Thu, 2 Jun 2011 01:26:00 +0000 (09:26 +0800)]
rl(4): Fix an old typo
If receiving buffer wrapping happens, the first size of copy should be the
size of the buffer at the end of the receiving buffer.
DragonFly-Bug: http://bugs.dragonflybsd.org/issue2083
Sepherosa Ziehau [Thu, 2 Jun 2011 01:21:25 +0000 (09:21 +0800)]
acpi: Fix use-before-initialization bug
Reported-by: swildner@
Sascha Wildner [Wed, 1 Jun 2011 21:50:54 +0000 (23:50 +0200)]
kernel: Use cpu_vendor_id instead of strcmp(cpu_vendor, "...").
Sepherosa Ziehau [Wed, 1 Jun 2011 09:17:15 +0000 (17:17 +0800)]
x86_64: Split cpu_startup() into pic_finish() and cpu_finish()
Sepherosa Ziehau [Wed, 1 Jun 2011 08:06:54 +0000 (16:06 +0800)]
x86_64: Prepare mp_enable() for multi-stage procedure segmentation
Sepherosa Ziehau [Wed, 1 Jun 2011 07:19:28 +0000 (15:19 +0800)]
kern: Prepare to split SI_BOOT2_SMP into multi-stages
Sepherosa Ziehau [Wed, 1 Jun 2011 06:32:04 +0000 (14:32 +0800)]
x86_64: Move base_memory from mp_machdep.c to machdep.c
Sascha Wildner [Wed, 1 Jun 2011 08:40:34 +0000 (10:40 +0200)]
<libutil.h>: Allow it to be included standalone (fixes security/heimdal).
Sepherosa Ziehau [Tue, 31 May 2011 07:08:30 +0000 (15:08 +0800)]
x86_64: Move int_to_apicintpin from mp_machdep.c to apic/ioapic_abi.c
Sepherosa Ziehau [Tue, 31 May 2011 04:54:43 +0000 (12:54 +0800)]
acpi/pstate: Don't allow intermittent disappearance of _PSD
Sepherosa Ziehau [Tue, 31 May 2011 04:37:21 +0000 (12:37 +0800)]
acpi/pstate: Support Integer _PSD
Standard _PSD should be package, while some buggy BIOSes will use Integer
for _PSD, e.g. Gigbyte's GA-H67MA-UD2H-B3.
Following template is used for Integer _PSD, after I have fiddled
around with the hw.acpi.cpu sysctl tree a little bit:
- Coordination is set to software all
- The integer of _PSD is taken as the power domain number
- The number of CPUs in the power domain is updated when new CPU in that
power domain is seen
Sepherosa Ziehau [Mon, 30 May 2011 15:02:31 +0000 (23:02 +0800)]
i386: Move int_to_apicintpin from mp_machdep.c to apic/ioapic_abi.c
Sepherosa Ziehau [Mon, 30 May 2011 15:01:17 +0000 (23:01 +0800)]
intr: Call machintr_intren() only for hardware interrupts
Sascha Wildner [Mon, 30 May 2011 14:28:39 +0000 (16:28 +0200)]
manpages: Remove a bunch of unneeded Pp macros.
Sascha Wildner [Sat, 28 May 2011 19:57:22 +0000 (21:57 +0200)]
LINT64: Uncomment vinum(4) (only VINUMDEBUG whines).
Sascha Wildner [Sat, 28 May 2011 19:41:44 +0000 (21:41 +0200)]
acpi: Add a missing initialization.
If acpi_get_handle() failed, the code would try to AcpiOsFree() a
garbage devinfo.
Sascha Wildner [Sat, 28 May 2011 07:57:13 +0000 (09:57 +0200)]
Adjust some more to reflect the desired order of manpage prologue macros.
Sascha Wildner [Sat, 28 May 2011 07:47:15 +0000 (09:47 +0200)]
Revert a change that I accidentally committed but which is not ready yet.
Sascha Wildner [Sat, 28 May 2011 07:43:08 +0000 (09:43 +0200)]
manpages: Uniformly order the prologue macros by Dd/Dt/Os.
This is the most widely used order and it also silences warnings
in mandoc -Tlint output.
Sascha Wildner [Sat, 28 May 2011 05:44:57 +0000 (07:44 +0200)]
Remove binutils 2.17 build hierarchy from gnu/.
Sascha Wildner [Sat, 28 May 2011 05:43:22 +0000 (07:43 +0200)]
Remove binutils 2.17 from contrib/.
Sascha Wildner [Sat, 28 May 2011 05:27:52 +0000 (07:27 +0200)]
Remove binutils 2.17 remains via 'make upgrade'.
Sascha Wildner [Fri, 27 May 2011 15:55:47 +0000 (17:55 +0200)]
libthread_xu: Fix a typo and add a missing STATIC_LIB_REQUIRE().
Reported-by: Goetz Isenmann <gisenmann@web.de>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2058>
Sascha Wildner [Fri, 27 May 2011 14:01:05 +0000 (16:01 +0200)]
edquota(8): Raise WARNS to 6.
Sepherosa Ziehau [Fri, 27 May 2011 14:04:20 +0000 (22:04 +0800)]
i386: Move mp_naps from mp_machdep.c to machdep.c
Sascha Wildner [Fri, 27 May 2011 13:50:13 +0000 (15:50 +0200)]
install(1): Raise WARNS to 6.
YONETANI Tomokazu [Fri, 27 May 2011 13:27:39 +0000 (22:27 +0900)]
kernel: Don't disturb about-to-be reaped zombies.
Processes in zombproc with p_nthreads == 0 are about to be reaped,
so just leave them in peace.
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1996>
Sepherosa Ziehau [Fri, 27 May 2011 12:34:25 +0000 (20:34 +0800)]
x86_64: Move mp_naps from mp_machdep.c to machdep.c
Sepherosa Ziehau [Fri, 27 May 2011 12:24:41 +0000 (20:24 +0800)]
i386: Move imcr_present from mp_machdep.c to machdep.c
Sepherosa Ziehau [Fri, 27 May 2011 12:09:34 +0000 (20:09 +0800)]
i386: Split out machine/mptable.h from machine/smp.h
Sepherosa Ziehau [Fri, 27 May 2011 12:02:29 +0000 (20:02 +0800)]
i386: Remove no longer used interrupt vector declaration
Sepherosa Ziehau [Fri, 27 May 2011 12:01:23 +0000 (20:01 +0800)]
i386: Set EBDA address even for UP
Sepherosa Ziehau [Fri, 27 May 2011 08:53:20 +0000 (16:53 +0800)]
re(4): Correct EEPROM location for certain versions of 8168F/8168E-VL
Sepherosa Ziehau [Fri, 27 May 2011 08:26:58 +0000 (16:26 +0800)]
re(4): Preliminary 8168F support
Sepherosa Ziehau [Fri, 27 May 2011 08:18:07 +0000 (16:18 +0800)]
re(4): Add 8168DP support
Sepherosa Ziehau [Fri, 27 May 2011 08:13:35 +0000 (16:13 +0800)]
re(4): Correct 8168E settings
Sascha Wildner [Fri, 27 May 2011 06:39:05 +0000 (08:39 +0200)]
sockstat(1): Fix a warning and raise WARNS to 6.
Sepherosa Ziehau [Thu, 26 May 2011 09:45:39 +0000 (17:45 +0800)]
powerd: Take 'nice' into consideration
Sascha Wildner [Thu, 26 May 2011 03:41:14 +0000 (05:41 +0200)]
devattr.8: Add missing .El
Sascha Wildner [Thu, 26 May 2011 03:38:03 +0000 (05:38 +0200)]
frexp.3: Use .Eo/.Ec instead of .Bo/.Pc
Sascha Wildner [Thu, 26 May 2011 03:26:33 +0000 (05:26 +0200)]
mkinitrd.8: Remove blank line.
Sascha Wildner [Thu, 26 May 2011 03:24:21 +0000 (05:24 +0200)]
prop_{array,dictionary}_util.3: Add missing .Nd's.
Sascha Wildner [Thu, 26 May 2011 03:10:06 +0000 (05:10 +0200)]
bridge.4: Add missing .Bl/.El
Sepherosa Ziehau [Wed, 25 May 2011 09:32:00 +0000 (17:32 +0800)]
x86_64: Move imcr_present from mp_machdep.c to machdep.c
Sepherosa Ziehau [Wed, 25 May 2011 09:21:21 +0000 (17:21 +0800)]
x86_64: Split out machine/mptable.h from machine/smp.h
Sepherosa Ziehau [Wed, 25 May 2011 09:03:20 +0000 (17:03 +0800)]
x86_64: Remove no longer used interrupt vector declaration
Sepherosa Ziehau [Wed, 25 May 2011 08:56:01 +0000 (16:56 +0800)]
x86_64: Set EBDA address even for UP
Sepherosa Ziehau [Wed, 25 May 2011 05:08:01 +0000 (13:08 +0800)]
acpi: Fix up the interrupt timer after enabling ACPI
So that the interrupt cputimer that is choked by ACPI power management
could be resurrected before probing various devices.
Sascha Wildner [Tue, 24 May 2011 21:30:30 +0000 (23:30 +0200)]
kernel/lapic: Remove the special handling for VMware w/ 1 CPU again.
I've done some further testing here and it looks like I was on the
wrong path when I reported it to sephe.
The problem seems to be a local one. It fails occasionally (SMP kernel
or not) when the ISO is on my file server, but always succeeds when
the ISO is on the disk of the box running VMware.
Sascha Wildner [Tue, 24 May 2011 14:14:51 +0000 (16:14 +0200)]
smp.4: Adjust the apic io tunable name to the preferred name.
Sepherosa Ziehau [Tue, 24 May 2011 13:08:05 +0000 (21:08 +0800)]
ioapic: Alias hw.apic_io_enable with hw.ioapic_enable
Sascha Wildner [Tue, 24 May 2011 13:52:09 +0000 (15:52 +0200)]
kernel: Remove unused #include.
Sascha Wildner [Tue, 24 May 2011 12:05:04 +0000 (14:05 +0200)]
nrelease/installer: No longer build and offer separate UP and SMP kernels.
Due to sephe's recent work, SMP kernels should boot on UP machines as
well. This is to give his work more exposure.
Also remove the (now redundant) *_SMP configs.
In-discussion-with: sephe
Sascha Wildner [Tue, 24 May 2011 12:04:43 +0000 (14:04 +0200)]
Put 'options SMP' in our standard GENERIC and X86_64_GENERIC configs.
Due to sephe's recent work, SMP kernels should boot on UP machines as
well. This is to give his work more exposure.
While doing this, remove the no longer needed APIC_IO options from
all configs (it is 1 by default since commit
ed4d621d) and comment
'options SMP' in the LINT* configs so the still existing UP code
paths are still build-tested.
In-discussion-with: sephe