[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/26] target/ppc: powerpc_excp: Set vector earlier
From: |
Cédric Le Goater |
Subject: |
[PULL 20/26] target/ppc: powerpc_excp: Set vector earlier |
Date: |
Tue, 4 Jan 2022 08:31:15 +0100 |
From: Fabiano Rosas <farosas@linux.ibm.com>
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 <farosas@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20211229165751.3774248-4-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/excp_helper.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 9e7c428821e1..35ac450590f5 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) {
--
2.31.1
- [PULL 00/26] ppc queue, Cédric Le Goater, 2022/01/04
- [PULL 04/26] pnv_phb3.c: do not set 'root-bus' as bus name, Cédric Le Goater, 2022/01/04
- [PULL 19/26] target/ppc: powerpc_excp: Add excp_vectors bounds check, Cédric Le Goater, 2022/01/04
- [PULL 24/26] target/ppc: Rewrite pmu_increment_insns, Cédric Le Goater, 2022/01/04
- [PULL 16/26] ppc/ppc405: Dump specific registers, Cédric Le Goater, 2022/01/04
- [PULL 07/26] target/ppc: Check effective address validity, Cédric Le Goater, 2022/01/04
- [PULL 21/26] target/ppc: powerpc_excp: Move system call vectored code together, Cédric Le Goater, 2022/01/04
- [PULL 17/26] target/ppc: do not silence snan in xscvspdpn, Cédric Le Goater, 2022/01/04
- [PULL 14/26] ppc/ppc405: Fix timer initialization, Cédric Le Goater, 2022/01/04
- [PULL 20/26] target/ppc: powerpc_excp: Set vector earlier,
Cédric Le Goater <=
- [PULL 11/26] ppc/ppc405: Activate MMU logs, Cédric Le Goater, 2022/01/04
- [PULL 05/26] pnv_phb4.c: do not set 'root-bus' as bus name, Cédric Le Goater, 2022/01/04
- [PULL 06/26] target/ppc: Improve logging in Radix MMU, Cédric Le Goater, 2022/01/04
- [PULL 13/26] ppc/ppc405: Rework ppc_40x_timers_init() to use a PowerPCCPU, Cédric Le Goater, 2022/01/04
- [PULL 12/26] ppc/ppc405: Restore TCR and STR write handlers, Cédric Le Goater, 2022/01/04
- [PULL 10/26] ppc/ppc4xx: Convert printfs(), Cédric Le Goater, 2022/01/04
- [PULL 18/26] target/ppc: powerpc_excp: Set alternate SRRs directly, Cédric Le Goater, 2022/01/04
- [PULL 08/26] target/ppc: Remove static inline, Cédric Le Goater, 2022/01/04