arm: force flag recalculation when messing with DAIF
RFC PATCH 1/1 arm: force flag recalculation when messing with DAIF
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.
--- target/arm/helper-a64.c | 2 ++ 1 file changed, 2 insertions(+)
target/arm/helper-a64.c +2 -0
@@ -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); }/* Convert a softfloat float_relation_ (as returned by
Signature · 1 line
2.30.2
Quoted 7 lines · Alex Bennée
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.
Signed-off-by Alex Bennée <[email protected]>Cc Richard Henderson <[email protected]>Cc Andrew Jones <[email protected]>
s/Cc: Andrew/Reported-by: Andrew/
and now also
Thanks,
drew
Quoted 26 lines
--- target/arm/helper-a64.c | 2 ++ 1 file changed, 2 insertions(+)target/arm/helper-a64.c +2
-0@@ -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); }/* Convert a softfloat float_relation_ (as returned by Signature · 1 line
2.30.2
Quoted 3 lines · Alex Bennée
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.
Quoted 15 lines
Signed-off-by Alex Bennée <[email protected]>Cc Richard Henderson <[email protected]>Cc Andrew Jones <[email protected]>--- target/arm/helper-a64.c | 2 ++ 1 file changed, 2 insertions(+)target/arm/helper-a64.c +0
-0@@ -83,12 +83,14 @@ void HELPER(msr_i_daifset)(CPUARMState *env, uint32_t imm) {daif_check (env,0x1e , imm,GETPC ());
target/arm/helper-a64.c void HELPER(msr_i_daifset)(CPUARMState *env, uint32_t imm) · line 94
Quoted 10 lines
target/arm/helper-a64.c +2
-0env->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,
r~
Peter Maydell
AppliedQuoted 11 lines · Alex Bennée
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.
Signed-off-by Alex Bennée <[email protected]>Cc Richard Henderson <[email protected]>Cc Andrew Jones <[email protected]>--- target/arm/helper-a64.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to target-arm.next, thanks.
-- PMM