freebsd-nq/sys/i386
Bruce Evans a4b8c657a3 Use a critical region to protect pushing of the parent's npx state to the
pcb for fork().  It was possible for the state to be saved twice when an
interrupt handler saved it concurrently.  This corrupted (reset) the state
because fnsave has the (in)convenient side effect of doing an implicit
fninit.  Mundane null pointer bugs were not possible, because we save to
an "arbitrary" process's pcb and not to the "right" place (npxproc).

Push the parent's %gs to the pcb for fork().  Changes to %gs before
fork() were not preserved in the child unless an accidental context
switch did the pushing.  Updated the list of pcb contents which is
supposed to inhibit bugs like this.  pcb_dr*, pcb_gs and pcb_ext were
missing.  Copying is correct for pcb_dr*, and pcb_ext is already
handled specially (although XXX'ly).

Reducing the savectx() call to an npxsave() call in rev.1.80 was a
mistake.  The above bugs are duplicated in many places, including in
savectx() itself.

The arbitraryness of the parent process pointer for the fork()
subroutines, the pcb pointer for savectx(), and the save87 pointer
for npxsave(), is illusory.  These functions don't work "right" unless
the pointers are precisely curproc, curpcb, and the address of npxproc's
save87 area, respectively, although the special context in which they
are called allows savectx(&dumppcb) to sort of work and npxsave(&dummy)
to work.  cpu_fork() just doesn't work unless the parent process
pointer is curproc, or the caller has pushed %gs to the pcb, or %gs
happens to already be in the pcb.
2001-05-13 07:44:14 +00:00
..
acpica FreeBSD-specific OSD (operating system dependant) modules for the Intel 2000-10-28 06:56:15 +00:00
apm Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
bios Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
conf Add support for gigabit ethernet cards based on the NatSemi DP83820 2001-05-11 19:56:39 +00:00
i386 Use a critical region to protect pushing of the parent's npx state to the 2001-05-13 07:44:14 +00:00
ibcs2 Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
include - Use sched_lock and critical regions to ensure that LDT updates are thread 2001-05-10 17:03:03 +00:00
isa Fixed panics in npx exception handling. When using IRQ13 exception 2001-05-02 13:06:58 +00:00
linux Preserve the state of the %gs register when setting up the signal 2001-05-12 03:23:10 +00:00
pci Un-swap irq/link byte values so that printf works. 2001-05-11 04:52:29 +00:00
svr4 Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
Makefile Update tags directive to reflect the new location of soft updates 2000-07-04 00:18:43 +00:00