Broken on 386
Broken on 386
Posted Mar 15, 2012 1:53 UTC (Thu) by slashdot (guest, #22014)Parent article: The x86 NMI iret problem
The linked commit is broken on original 386 CPUs without cmpxchg.
cmpxchg() is emulated by disabling interrupts, but of course NMIs aren't disabled, so there's a race that can read to a loss of the nested NMI on 386 CPUs.
This seems fixable by replacing cmpxchg() with local_dec_and_test() after setting NOT_RUNNING = 0, EXECUTING = 1, LATCHED = 2, which doesn't have a race condition, since the LATCHED -> EXECUTING transition is harmless.
