|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH 03/10] target/ppc: Move common check in exception handlers to a function |
Date: | Mon, 12 Jun 2023 11:28:09 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 |
On 12/6/23 00:42, BALATON Zoltan wrote:
All powerpc exception handlers share some code when handling machine check exceptions. Move this to a common function. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> --- target/ppc/excp_helper.c | 112 ++++++++------------------------------- 1 file changed, 23 insertions(+), 89 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 3783315fdb..e4532f5088 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -403,6 +403,23 @@ static void powerpc_set_excp_state(PowerPCCPU *cpu, target_ulong vector, env->reserve_addr = -1; }+static void powerpc_checkstop_state(CPUPPCState *env)+{ + if (!FIELD_EX64(env->msr, MSR, ME)) {
Preferably inverting this if() and returning early: Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
+ CPUState *cs = env_cpu(env); + + /* Machine check exception is not enabled. Enter checkstop state. */ + fprintf(stderr, "Machine check while not allowed. " + "Entering checkstop state\n"); + if (qemu_log_separate()) { + qemu_log("Machine check while not allowed. " + "Entering checkstop state\n"); + } + cs->halted = 1; + cpu_interrupt_exittb(cs); + } +}
[Prev in Thread] | Current Thread | [Next in Thread] |