On 8/1/25 05:13, Pierrick Bouvier wrote:
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c
index 71c6c44ee8..f61adf1f80 100644
--- a/target/arm/tcg/helper-a64.c
+++ b/target/arm/tcg/helper-a64.c
@@ -639,7 +639,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t 
new_pc)
      ARMCPU *cpu = env_archcpu(env);
      int cur_el = arm_current_el(env);
      unsigned int spsr_idx = aarch64_banked_spsr_index(cur_el);
-    uint32_t spsr = env->banked_spsr[spsr_idx];
+    uint64_t spsr = env->banked_spsr[spsr_idx];
      int new_el;
      bool return_to_aa64 = (spsr & PSTATE_nRW) == 0;

Would that be better or worse to simply save the upper 32 bits, considering that cpsr already holds the lower ones in Aarch64 mode?

I don't understand this comment.

(1) banked_spsr[] is already uint64_t
(2) SPSR_ELx is supposed to be uint64_t
(3) We were accidentally dropping the high bits of spsr here
    because the local variable had the wrong type, before it
    gets sent to pstate_write().


r~

Reply via email to