freebsd-skq/sys/amd64
bde 84c70c2dfb 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
amd64 Use a critical region to protect pushing of the parent's npx state to the 2001-05-13 07:44:14 +00:00
conf Turn on kernel debugging support (DDB, INVARIANTS, INVARIANT_SUPPORT, WITNESS) 2001-04-15 19:37:28 +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
pci Un-swap irq/link byte values so that printf works. 2001-05-11 04:52:29 +00:00
Makefile Update tags directive to reflect the new location of soft updates 2000-07-04 00:18:43 +00:00