a4b8c657a3
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. |
||
---|---|---|
.. | ||
amd64_mem.c | ||
amd64-gdbstub.c | ||
apic_vector.S | ||
atomic.c | ||
autoconf.c | ||
bios.c | ||
busdma_machdep.c | ||
cpu_switch.S | ||
db_disasm.c | ||
db_interface.c | ||
db_trace.c | ||
elf_machdep.c | ||
exception.s | ||
exception.S | ||
fpu.c | ||
genassym.c | ||
identcpu.c | ||
in_cksum.c | ||
initcpu.c | ||
legacy.c | ||
locore.s | ||
locore.S | ||
machdep.c | ||
mem.c | ||
mp_machdep.c | ||
mpboot.S | ||
mptable.c | ||
nexus.c | ||
pmap.c | ||
prof_machdep.c | ||
support.s | ||
support.S | ||
swtch.s | ||
sys_machdep.c | ||
trap.c | ||
tsc.c | ||
vm_machdep.c |