[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] target/ppc: Add machine check interrupt injection helper
From: |
Nicholas Piggin |
Subject: |
[PATCH 3/4] target/ppc: Add machine check interrupt injection helper |
Date: |
Fri, 19 Jan 2024 00:34:58 +1000 |
This matches the NMI injection helper function.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/spapr_events.c | 3 +--
target/ppc/excp_helper.c | 7 +++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index cb0eeee587..4be9a5ba3a 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -875,8 +875,7 @@ void spapr_mce_req_event(PowerPCCPU *cpu, bool recovered)
if (spapr->fwnmi_machine_check_addr == -1) {
/* Non-FWNMI case, deliver it like an architected CPU interrupt. */
- cs->exception_index = POWERPC_EXCP_MCHECK;
- ppc_cpu_do_interrupt(cs);
+ ppc_cpu_do_machine_check(cs);
return;
}
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 58fd08729a..133477acba 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -2601,6 +2601,13 @@ void ppc_cpu_do_system_reset(CPUState *cs)
powerpc_excp(cpu, POWERPC_EXCP_RESET);
}
+void ppc_cpu_do_machine_check(CPUState *cs)
+{
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+
+ powerpc_excp(cpu, POWERPC_EXCP_MCHECK);
+}
+
void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector)
{
PowerPCCPU *cpu = POWERPC_CPU(cs);
--
2.42.0