From: Fabiano Rosas Date: Tue, 4 Jan 2022 06:55:34 +0000 (+0100) Subject: target/ppc: powerpc_excp: Set vector earlier X-Git-Tag: qemu-xen-4.17.0-rc4~153^2~6 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d1cbee61abd5ca76cd04886d066e18fcda8d1116;p=qemu-xen.git target/ppc: powerpc_excp: Set vector earlier None of the interrupt setup code touches 'vector', so we can move it earlier in the function. This will allow us to later move the System Call Vectored setup that is on the top level into the POWERPC_EXCP_SYSCALL_VECTORED code block. This patch also moves the verification for when 'excp' does not have an address associated with it. We now bail a little earlier when that is the case. This should not cause any visible effects. Signed-off-by: Fabiano Rosas Reviewed-by: Cédric Le Goater Reviewed-by: Richard Henderson Reviewed-by: David Gibson Message-Id: <20211229165751.3774248-4-farosas@linux.ibm.com> Signed-off-by: Cédric Le Goater --- diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 9e7c428821..35ac450590 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -429,6 +429,14 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp) } #endif + vector = env->excp_vectors[excp]; + if (vector == (target_ulong)-1ULL) { + cpu_abort(cs, "Raised an exception without defined vector %d\n", + excp); + } + + vector |= env->excp_prefix; + switch (excp) { case POWERPC_EXCP_CRITICAL: /* Critical input */ switch (excp_model) { @@ -905,14 +913,6 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp) } #endif - vector = env->excp_vectors[excp]; - if (vector == (target_ulong)-1ULL) { - cpu_abort(cs, "Raised an exception without defined vector %d\n", - excp); - } - - vector |= env->excp_prefix; - #if defined(TARGET_PPC64) if (excp_model == POWERPC_EXCP_BOOKE) { if (env->spr[SPR_BOOKE_EPCR] & EPCR_ICM) {