On Wed, 14 Jul 2010, Linus Torvalds wrote:
quoted text > No. As mentioned, there is no such counter in real hardware either.
There is a 1-bit counter or actually a latch.
quoted text > Look at what happens for the not-nested case:
>
> - NMI1 triggers. The CPU takes a fault, and runs the NMI handler with
> NMI's disabled
Correct.
quoted text > - NMI2 triggers. Nothing happens, the NMI's are disabled.
The NMI latch records the second NMI. Note this is edge-sensitive like
the NMI line itself.
quoted text > - NMI3 triggers. Again, nothing happens, the NMI's are still disabled
Correct.
quoted text > - the NMI handler returns.
>
> - What happens now?
NMI2 latched above causes the NMI handler to be invoked as the next
instruction after IRET. The latch is cleared as the interrupt is taken.
quoted text > How many NMI interrupts do you get? ONE. Exactly like my "emulate it
> in software" approach. The hardware doesn't have any counters for
> pending NMI's either. Why should the software emulation have them?
Two. :)
Maciej
--
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
Re: [patch 1/2] x86_64 page fault NMI-safe , Maciej W. Rozycki , (Wed Jul 14, 2:45 pm)