qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH] arm: force flag recalculation when messing with DAIF


From: Richard Henderson
Subject: Re: [RFC PATCH] arm: force flag recalculation when messing with DAIF
Date: Sun, 6 Feb 2022 13:10:49 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/2/22 23:23, Alex Bennée wrote:
The recently introduced debug tests in kvm-unit-tests exposed an error
in our handling of singlestep cause by stale hflags. This is caught by
--enable-debug-tcg when running the tests.

You could mention that PSTATE_D is used by aa64_generate_debug_exceptions.


Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Andrew Jones <drjones@redhat.com>
---
  target/arm/helper-a64.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c
index d6a6fd73d9..7cf953b1e6 100644
--- a/target/arm/helper-a64.c
+++ b/target/arm/helper-a64.c
@@ -83,12 +83,14 @@ void HELPER(msr_i_daifset)(CPUARMState *env, uint32_t imm)
  {
      daif_check(env, 0x1e, imm, GETPC());
      env->daif |= (imm << 6) & PSTATE_DAIF;
+    arm_rebuild_hflags(env);
  }
void HELPER(msr_i_daifclear)(CPUARMState *env, uint32_t imm)
  {
      daif_check(env, 0x1f, imm, GETPC());
      env->daif &= ~((imm << 6) & PSTATE_DAIF);
+    arm_rebuild_hflags(env);
  }

You could call helper_rebuild_hflags_a64 directly, since we know that we must be in a64 state to get here. Regardless,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]