[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 10/13] target/ppc: allow ppc_cpu_do_system_reset to take an a
From: |
Nicholas Piggin |
Subject: |
[RFC PATCH 10/13] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector |
Date: |
Wed, 4 Mar 2020 15:28:47 +1000 |
Provide for an alternate delivery location, -1 defaults to the
architected address.
Signed-off-by: Nicholas Piggin <address@hidden>
---
hw/ppc/spapr.c | 2 +-
target/ppc/cpu.h | 2 +-
target/ppc/excp_helper.c | 5 ++++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a8c6dbc5bd..4f46ea67ca 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3392,7 +3392,7 @@ static void spapr_machine_finalizefn(Object *obj)
void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg)
{
cpu_synchronize_state(cs);
- ppc_cpu_do_system_reset(cs);
+ ppc_cpu_do_system_reset(cs, -1);
}
static void spapr_nmi(NMIState *n, int cpu_index, Error **errp)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index f8567a0621..efdd18d26b 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1231,7 +1231,7 @@ int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f,
CPUState *cs,
int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
int cpuid, void *opaque);
#ifndef CONFIG_USER_ONLY
-void ppc_cpu_do_system_reset(CPUState *cs);
+void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector);
void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector);
extern const VMStateDescription vmstate_ppc_cpu;
#endif
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 7f2b5899d3..08bc885ca6 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -961,12 +961,15 @@ static void ppc_hw_interrupt(CPUPPCState *env)
}
}
-void ppc_cpu_do_system_reset(CPUState *cs)
+void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector)
{
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_RESET);
+ if (vector != -1) {
+ env->nip = vector;
+ }
}
void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector)
--
2.23.0
- Re: [RFC PATCH 04/13] ppc/spapr: Disable FWNMI capability if KVM does not support it, (continued)
[RFC PATCH 05/13] ppc/spapr: Fix FWNMI machine check interrupt delivery, Nicholas Piggin, 2020/03/04
[RFC PATCH 06/13] ppc/spapr: Fix FWNMI machine check failure handling, Nicholas Piggin, 2020/03/04
[RFC PATCH 09/13] ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery fails, Nicholas Piggin, 2020/03/04
[RFC PATCH 07/13] ppc/spapr: Improve FWNMI machine check delivery corner case comments, Nicholas Piggin, 2020/03/04
[RFC PATCH 08/13] ppc/spapr: Add FWNMI machine check delivery warnings, Nicholas Piggin, 2020/03/04
[RFC PATCH 10/13] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector,
Nicholas Piggin <=
[RFC PATCH 12/13] ppc/spapr: Allow FWNMI on TCG, Nicholas Piggin, 2020/03/04
[RFC PATCH 11/13] ppc/spapr: Implement FWNMI System Reset delivery, Nicholas Piggin, 2020/03/04
[RFC PATCH 13/13] ppc/spapr: KVM should not enable FWNMI until the guest requests it, Nicholas Piggin, 2020/03/04