[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/26] target/ppc: powerpc_excp: Set alternate SRRs directly
From: |
Cédric Le Goater |
Subject: |
[PULL 18/26] target/ppc: powerpc_excp: Set alternate SRRs directly |
Date: |
Tue, 4 Jan 2022 08:31:13 +0100 |
From: Fabiano Rosas <farosas@linux.ibm.com>
There are currently only two interrupts that use alternate SRRs, so
let them write to them directly during the setup code.
No functional change intended.
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20211229165751.3774248-2-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/excp_helper.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index e3380722c5c4..c7efbdc3051b 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -370,7 +370,7 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp_model,
int excp)
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
target_ulong msr, new_msr, vector;
- int srr0, srr1, asrr0, asrr1, lev = -1;
+ int srr0, srr1, lev = -1;
qemu_log_mask(CPU_LOG_INT, "Raise exception at " TARGET_FMT_lx
" => %s (%d) error=%02x\n", env->nip,
powerpc_excp_name(excp),
@@ -392,8 +392,6 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp_model,
int excp)
/* target registers */
srr0 = SPR_SRR0;
srr1 = SPR_SRR1;
- asrr0 = -1;
- asrr1 = -1;
/*
* check for special resume at 0x100 from doze/nap/sleep/winkle on
@@ -483,8 +481,9 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp_model,
int excp)
/* FIXME: choose one or the other based on CPU type */
srr0 = SPR_BOOKE_MCSRR0;
srr1 = SPR_BOOKE_MCSRR1;
- asrr0 = SPR_BOOKE_CSRR0;
- asrr1 = SPR_BOOKE_CSRR1;
+
+ env->spr[SPR_BOOKE_CSRR0] = env->nip;
+ env->spr[SPR_BOOKE_CSRR1] = msr;
break;
default:
break;
@@ -643,8 +642,10 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp_model,
int excp)
/* FIXME: choose one or the other based on CPU type */
srr0 = SPR_BOOKE_DSRR0;
srr1 = SPR_BOOKE_DSRR1;
- asrr0 = SPR_BOOKE_CSRR0;
- asrr1 = SPR_BOOKE_CSRR1;
+
+ env->spr[SPR_BOOKE_CSRR0] = env->nip;
+ env->spr[SPR_BOOKE_CSRR1] = msr;
+
/* DBSR already modified by caller */
} else {
cpu_abort(cs, "Debug exception triggered on unsupported model\n");
@@ -911,14 +912,6 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp_model,
int excp)
vector |= env->excp_prefix;
- /* If any alternate SRR register are defined, duplicate saved values */
- if (asrr0 != -1) {
- env->spr[asrr0] = env->nip;
- }
- if (asrr1 != -1) {
- env->spr[asrr1] = msr;
- }
-
#if defined(TARGET_PPC64)
if (excp_model == POWERPC_EXCP_BOOKE) {
if (env->spr[SPR_BOOKE_EPCR] & EPCR_ICM) {
--
2.31.1
- [PULL 14/26] ppc/ppc405: Fix timer initialization, (continued)
- [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, 2022/01/04
- [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 <=
- [PULL 08/26] target/ppc: Remove static inline, Cédric Le Goater, 2022/01/04
- [PULL 09/26] target/ppc: Print out literal exception names in logs, Cédric Le Goater, 2022/01/04
- [PULL 02/26] ppc/pnv: Remove PHB4 reset handler, Cédric Le Goater, 2022/01/04
- [PULL 23/26] target/ppc: Cache per-pmc insn and cycle count settings, Cédric Le Goater, 2022/01/04
- [PULL 15/26] ppc/ppc405: Introduce a store helper for SPR_40x_PID, Cédric Le Goater, 2022/01/04
- [PULL 22/26] target/ppc: powerpc_excp: Stop passing excp_model around, Cédric Le Goater, 2022/01/04
- [PULL 03/26] ppc/pnv: Remove the PHB4 "device-id" property, Cédric Le Goater, 2022/01/04
- [PULL 26/26] target/ppc: do not call hreg_compute_hflags() in helper_store_mmcr0(), Cédric Le Goater, 2022/01/04
- [PULL 25/26] target/ppc: Use env->pnc_cyc_cnt, Cédric Le Goater, 2022/01/04
- [PULL 01/26] ppc/pnv: Change the maximum of PHB3 devices for Power8NVL, Cédric Le Goater, 2022/01/04