[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.16 15/31] target/ppc: Fix non-maskable interrupt while halte
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.16 15/31] target/ppc: Fix non-maskable interrupt while halted |
Date: |
Tue, 28 Jan 2025 00:41:07 +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 839d95c1eb..037efc04af 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -2511,10 +2511,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);
}
@@ -2536,6 +2542,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-7.2.16 04/31] cirrus-ci: Remove MSYS2 jobs duplicated with gitlab-ci, (continued)
- [Stable-7.2.16 04/31] cirrus-ci: Remove MSYS2 jobs duplicated with gitlab-ci, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 05/31] virtio-net: Fix size check in dhclient workaround, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 06/31] qdev: Fix set_pci_devfn() to visit option only once, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 07/31] ssh: Do not switch session to non-blocking mode, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 08/31] scsi: megasas: Internal cdbs have 16-byte length, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 09/31] tests/9p: fix Rreaddir response name, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 10/31] tests/9p: add missing Rgetattr response name, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 11/31] tests/9p: add 'use-after-unlink' test, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 12/31] 9pfs: remove obsolete comment in v9fs_getattr(), Michael Tokarev, 2025/01/28
- [Stable-7.2.16 14/31] tests/9p: also check 'Tgetattr' in 'use-after-unlink' test, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 15/31] target/ppc: Fix non-maskable interrupt while halted,
Michael Tokarev <=
- [Stable-7.2.16 13/31] 9pfs: fix 'Tgetattr' after unlink, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 16/31] hw/openrisc/openrisc_sim: keep serial@90000000 as default, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 17/31] tcg/riscv: Fix StoreStore barrier generation, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 18/31] fuzz: specify audiodev for usb-audio, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 19/31] x86/loader: only patch linux kernels, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 21/31] meson.build: Disallow libnfs v6 to fix the broken macOS build, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 20/31] hw/intc/arm_gicv3_its: Zero initialize local DTEntry etc structs, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 22/31] s390x/s390-virtio-ccw: don't crash on weird RAM sizes, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 23/31] docs: Correct release of TCG trace-events removal, Michael Tokarev, 2025/01/28
- [Stable-7.2.16 24/31] target/i386/cpu: Fix notes for CPU models, Michael Tokarev, 2025/01/28