[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 39/42] target/ppc: books: Remove excp_model argument from ppc_excp
From: |
Cédric Le Goater |
Subject: |
[PULL 39/42] target/ppc: books: Remove excp_model argument from ppc_excp_apply_ail |
Date: |
Thu, 10 Feb 2022 14:00:05 +0100 |
From: Fabiano Rosas <farosas@linux.ibm.com>
We don't really need to check for exception model while applying
AIL. We can check the lpcr_mask for the presence of
LPCR_AIL/LPCR_HAIL.
This removes one more instance of passing the exception model ID
around.
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20220207183036.1507882-5-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/excp_helper.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 83be6698dfd4..fcc83a77015f 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -262,11 +262,10 @@ static int powerpc_reset_wakeup(CPUState *cs, CPUPPCState
*env, int excp,
* | a | h | 11 | 1 | 1 | h |
* +--------------------------------------------------------------------+
*/
-static void ppc_excp_apply_ail(PowerPCCPU *cpu, int excp_model, int excp,
- target_ulong msr,
- target_ulong *new_msr,
- target_ulong *vector)
+static void ppc_excp_apply_ail(PowerPCCPU *cpu, int excp, target_ulong msr,
+ target_ulong *new_msr, target_ulong *vector)
{
+ PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
CPUPPCState *env = &cpu->env;
bool mmu_all_on = ((msr >> MSR_IR) & 1) && ((msr >> MSR_DR) & 1);
bool hv_escalation = !(msr & MSR_HVB) && (*new_msr & MSR_HVB);
@@ -279,8 +278,13 @@ static void ppc_excp_apply_ail(PowerPCCPU *cpu, int
excp_model, int excp,
return;
}
- if (excp_model == POWERPC_EXCP_POWER8 ||
- excp_model == POWERPC_EXCP_POWER9) {
+ if (!(pcc->lpcr_mask & LPCR_AIL)) {
+ /* This CPU does not have AIL */
+ return;
+ }
+
+ /* P8 & P9 */
+ if (!(pcc->lpcr_mask & LPCR_HAIL)) {
if (!mmu_all_on) {
/* AIL only works if MSR[IR] and MSR[DR] are both enabled. */
return;
@@ -303,7 +307,8 @@ static void ppc_excp_apply_ail(PowerPCCPU *cpu, int
excp_model, int excp,
return;
}
- } else if (excp_model == POWERPC_EXCP_POWER10) {
+ /* P10 and up */
+ } else {
if (!mmu_all_on && !hv_escalation) {
/*
* AIL works for HV interrupts even with guest MSR[IR/DR] disabled.
@@ -328,9 +333,6 @@ static void ppc_excp_apply_ail(PowerPCCPU *cpu, int
excp_model, int excp,
/* AIL=1 and AIL=2 are reserved, treat them like AIL=0 */
return;
}
- } else {
- /* Other processors do not support AIL */
- return;
}
/*
@@ -1280,7 +1282,6 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
{
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
- int excp_model = env->excp_model;
target_ulong msr, new_msr, vector;
int srr0, srr1, lev = -1;
@@ -1551,7 +1552,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
}
/* This can update new_msr and vector if AIL applies */
- ppc_excp_apply_ail(cpu, excp_model, excp, msr, &new_msr, &vector);
+ ppc_excp_apply_ail(cpu, excp, msr, &new_msr, &vector);
powerpc_set_excp_state(cpu, vector, new_msr);
}
--
2.34.1
- [PULL 31/42] target/ppc: 7xx: Program exception cleanup, (continued)
- [PULL 31/42] target/ppc: 7xx: Program exception cleanup, Cédric Le Goater, 2022/02/10
- [PULL 37/42] target/ppc: powerpc_excp: Move common code to the caller function, Cédric Le Goater, 2022/02/10
- [PULL 36/42] target/ppc: Remove powerpc_excp_legacy, Cédric Le Goater, 2022/02/10
- [PULL 42/42] spapr/vof: Install rom and nvram binaries, Cédric Le Goater, 2022/02/10
- [PULL 02/42] target/ppc: Introduce powerpc_excp_booke, Cédric Le Goater, 2022/02/10
- [PULL 10/42] target/ppc: booke: System Call exception cleanup, Cédric Le Goater, 2022/02/10
- [PULL 21/42] target/ppc: 6xx: Program exception cleanup, Cédric Le Goater, 2022/02/10
- [PULL 14/42] target/ppc: Remove PowerPC 601 CPUs, Cédric Le Goater, 2022/02/10
- [PULL 23/42] target/ppc: 6xx: System Reset interrupt cleanup, Cédric Le Goater, 2022/02/10
- [PULL 30/42] target/ppc: 7xx: External interrupt cleanup, Cédric Le Goater, 2022/02/10
- [PULL 39/42] target/ppc: books: Remove excp_model argument from ppc_excp_apply_ail,
Cédric Le Goater <=
- [PULL 34/42] target/ppc: 7xx: Software TLB cleanup, Cédric Le Goater, 2022/02/10
- [PULL 05/42] target/ppc: booke: Machine Check cleanups, Cédric Le Goater, 2022/02/10
- [PULL 17/42] target/ppc: Simplify powerpc_excp_6xx, Cédric Le Goater, 2022/02/10
- [PULL 26/42] target/ppc: Merge 7x5 and 7x0 exception model IDs, Cédric Le Goater, 2022/02/10
- [PULL 13/42] target/ppc: Fix radix logging, Cédric Le Goater, 2022/02/10
- [PULL 38/42] target/ppc: Assert if MSR bits differ from msr_mask during exceptions, Cédric Le Goater, 2022/02/10
- [PULL 16/42] target/ppc: Introduce powerpc_excp_6xx, Cédric Le Goater, 2022/02/10
- [PULL 24/42] target/ppc: 6xx: Software TLB exceptions cleanup, Cédric Le Goater, 2022/02/10
- [PULL 28/42] target/ppc: Simplify powerpc_excp_7xx, Cédric Le Goater, 2022/02/10
- [PULL 22/42] target/ppc: 6xx: System Call exception cleanup, Cédric Le Goater, 2022/02/10