target/ppc: Fix non-maskable interrupt while halted
authorNicholas Piggin <npiggin@gmail.com>
Mon, 11 Nov 2024 06:37:49 +0000 (16:37 +1000)
committerNicholas Piggin <npiggin@gmail.com>
Tue, 26 Nov 2024 16:47:25 +0000 (02:47 +1000)
commitfa416ae6157a933ad3f7106090684759baaaf3c9
tree162e5fbaaf2276cd72832efbec14e2da20661e98
parentba54a7e6b86884e43bed2d2f5a79c719059652a8
target/ppc: Fix non-maskable interrupt while halted

The ppc (pnv and spapr) NMI injection code does not go through the
asynchronous interrupt path and set a bit in env->pending_interrupts
and raise an interrupt request that the cpu_exec() loop can see.
Instead it injects the exception directly into registers.

This can lead to cpu_exec() missing that the thread has work to do,
if a NMI is injected while it was idle.

Fix this by clearing halted when injecting the interrupt. Probably
NMI injection should be reworked to use the interrupt request interface,
but this seems to work as a minimal fix.

Fixes: 3431648272d3 ("spapr: Add support for new NMI interface")
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
target/ppc/excp_helper.c