[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.3 19/58] target/ppc: Fix non-maskable interrupt while halted
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.3 19/58] target/ppc: Fix non-maskable interrupt while halted |
Date: |
Mon, 27 Jan 2025 23:25:05 +0300 |
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>
(cherry picked from commit fa416ae6157a933ad3f7106090684759baaaf3c9)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index f33fc36db2..cc4ef2598c 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -2479,10 +2479,16 @@ static void ppc_deliver_interrupt(CPUPPCState *env, int
interrupt)
}
}
+/*
+ * system reset is not delivered via normal irq method, so have to set
+ * halted = 0 to resume CPU running if it was halted. Possibly we should
+ * move it over to using PPC_INTERRUPT_RESET rather than async_run_on_cpu.
+ */
void ppc_cpu_do_system_reset(CPUState *cs)
{
PowerPCCPU *cpu = POWERPC_CPU(cs);
+ cs->halted = 0;
powerpc_excp(cpu, POWERPC_EXCP_RESET);
}
@@ -2504,6 +2510,7 @@ void ppc_cpu_do_fwnmi_machine_check(CPUState *cs,
target_ulong vector)
/* Anything for nested required here? MSR[HV] bit? */
+ cs->halted = 0;
powerpc_set_excp_state(cpu, vector, msr);
}
--
2.39.5
- [Stable-9.1.3 11/58] ppc/spapr: fix drc index mismatch for partially enabled vcpus, (continued)
- [Stable-9.1.3 11/58] ppc/spapr: fix drc index mismatch for partially enabled vcpus, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 12/58] scsi: megasas: Internal cdbs have 16-byte length, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 13/58] tests/9p: fix Rreaddir response name, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 14/58] tests/9p: add missing Rgetattr response name, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 16/58] 9pfs: remove obsolete comment in v9fs_getattr(), Michael Tokarev, 2025/01/28
- [Stable-9.1.3 15/58] tests/9p: add 'use-after-unlink' test, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 17/58] 9pfs: fix 'Tgetattr' after unlink, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 18/58] tests/9p: also check 'Tgetattr' in 'use-after-unlink' test, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 20/58] target/ppc: Fix THREAD_SIBLING_FOREACH for multi-socket, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 21/58] hw/nvme: fix msix_uninit with exclusive bar, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 19/58] target/ppc: Fix non-maskable interrupt while halted,
Michael Tokarev <=
- [Stable-9.1.3 24/58] target/riscv: Avoid bad shift in riscv_cpu_do_interrupt(), Michael Tokarev, 2025/01/28
- [Stable-9.1.3 26/58] tcg: Reset free_temps before tcg_optimize, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 25/58] 9pfs: fix regression regarding CVE-2023-2861, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 30/58] pc-bios: add missing riscv64 descriptor, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 27/58] tcg/riscv: Fix StoreStore barrier generation, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 31/58] hw/intc/arm_gicv3_its: Zero initialize local DTEntry etc structs, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 28/58] x86/loader: only patch linux kernels, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 22/58] hw/nvme: take a reference on the subsystem on vf realization, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 32/58] meson.build: Disallow libnfs v6 to fix the broken macOS build, Michael Tokarev, 2025/01/28
- [Stable-9.1.3 29/58] roms: re-add edk2-basetools target, Michael Tokarev, 2025/01/28