Re: [RISC-V] [tech-fast-int] [RISC-V] [tech-privileged] Resumable NMI proposal
Jonathan Behrens <behrensj@...>
toggle quoted message Show quoted text
I suppose it depends on the exact design of the watchdog timer. In the scheme I'm familiar with, an NMI arrives every few seconds regardless of the state of the system. Then the interrupt handler is responsible for checking whether the system is alive (which it is 99.999% of the time) and only becomes fatal if not.
On Thu, Jan 28, 2021 at 8:31 PM Allen Baum <allen.baum@...> wrote:
If you're not (or can't) resume the interrupted process - it's fatal. No forward progress is fatal, and I would classify watchdog timer interrupts as fatal.The performance monitoring example is not.On Thu, Jan 28, 2021 at 5:06 PM Jonathan Behrens <behrensj@...> wrote:On Thu, Jan 28, 2021 at 7:05 PM Richard Trauben via lists.riscv.org <rtrauben=gmail.com@...> wrote:1) Is anyone using non maskable
interrupt for anything other
than fatal conditions?
a) if so,why not just increase the range of interrupt
priority levels, relocate the maskable interrupt priority handlers to the lower portion,
convert non fatal NMI sources into
maskable interrupts in the upper portion of the range?One case where NMIs are used on x86 for non-fatal conditions is for performance monitoring. If an operating system wants to accurately measure its own performance, then ideally it should be able to sample the current instruction pointer even during critical sections where interrupts are disabled.A second case where this comes up is for watchdog timers. If an operating system wants to detect if it ever becomes deadlocked with interrupts disabled, it can schedule an NMI every few seconds and verify if there has been any forward progress since the last one. In this case, the NMI itself isn't fatal even though failing one of these liveness checks will likely trigger a reboot (but hopefully after saving some diagnostic information to find out what went wrong).