freebsd-dev/sys/ia64
Marcel Moolenaar 51a325a7f9 Close a race relating to setting the PCPU pointer (r13). Register r13
points to the TLS in user space and points to the PCPU structure in
the kernel. The race is the result of having the exception handler on
the one hand and the RPC system call entry on the other. The EPC
syscall path is non-atomic in that interrupts are enabled while the
two stacks are switched. The register stack is switched last as that
is the stack used to determine whether we're going back to user space
by the exception handler. If we go back to user space, we restore r13,
otherwise we leave r13 alone. The EPC syscall path however set r13 to
the PCPU structure *before* switching the register stack, which means
that there was a window in which the exception handler would restore
r13 when it was already pointing to the PCPU structure. This is fatal
when the exception happened on CPU x, but left from the exception on
anotehr CPU. In that case r13 would point to the PCPU of the CPU the
thread was running on. This immediately results in getting the wrong
value for curthread.
The fix is to make sure we assign r13 *after* we set ar.bspstore to
point to the kernel register stack for the thread.
2013-02-17 00:51:34 +00:00
..
acpica Improve style(9) in the previous commit. 2012-06-01 17:07:52 +00:00
compile
conf Remove firewire devices missed in r244992. 2013-01-04 15:29:50 +00:00
disasm Fix disassembly of the invala, itc, itr and hint instructions 2007-10-16 02:49:40 +00:00
ia32 userret() already checks for td_locks when INVARIANTS is enabled, so 2012-09-08 18:27:11 +00:00
ia64 Close a race relating to setting the PCPU pointer (r13). Register r13 2013-02-17 00:51:34 +00:00
include Eliminate padding by moving 'narg' next to 'code'. Both are 32-bit 2013-02-12 17:24:41 +00:00
isa Retire isa_setup_intr() and isa_teardown_intr() and use the generic bus 2011-05-06 13:48:53 +00:00
pci Snapshot: PCI busses are discovered, though no devices are enumerable 2010-04-17 02:28:28 +00:00