[PATCH 8/9] target/ppc: powerpc_excp: Move AIL under a Book3s block

Fabiano Rosas posted 9 patches 4 years, 1 month ago
There is a newer version of this series
[PATCH 8/9] target/ppc: powerpc_excp: Move AIL under a Book3s block
Posted by Fabiano Rosas 4 years, 1 month ago
AIL only applies for Book3s CPUs, so move it along with ILE. This
moves ILE further down in the file because the AIL function can alter
vector so we cannot move it up.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
---
 target/ppc/excp_helper.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index d7e087f2f6..a4787c3ae2 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -766,14 +766,6 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp)
         }
     }
 
-    /*
-     * We preserve MSR_LE, but some CPUs can take interrupts in a
-     * different endianness.
-     */
-    if (excp_model >= POWERPC_EXCP_970) {
-        ppc_excp_toggle_ile(cpu, &new_msr);
-    }
-
 #if defined(TARGET_PPC64)
     if (excp_model == POWERPC_EXCP_BOOKE) {
         if (env->spr[SPR_BOOKE_EPCR] & EPCR_ICM) {
@@ -799,8 +791,16 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp)
         env->spr[srr1] = msr;
     }
 
-    /* This can update new_msr and vector if AIL applies */
-    ppc_excp_apply_ail(cpu, excp_model, excp, msr, &new_msr, &vector);
+    if (excp_model >= POWERPC_EXCP_970) {
+        /*
+         * We preserve MSR_LE, but some CPUs can take interrupts in a
+         * different endianness.
+         */
+        ppc_excp_toggle_ile(cpu, &new_msr);
+
+        /* This can update new_msr and vector if AIL applies */
+        ppc_excp_apply_ail(cpu, excp_model, excp, msr, &new_msr, &vector);
+    }
 
     powerpc_set_excp_state(cpu, vector, new_msr);
 }
-- 
2.33.1