Skip to contentSkip to conversation

target/arm: fix handling of HCR.FB

PATCH Applied [email protected] 2 participants 2 messages Oct 29, 2020 – Oct 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm: fix handling of HCR.FB

From: Rémi Denis-Courmont <[email protected]>

HCR should be applied when NS is set, not when it is cleared.

---
 target/arm/helper.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
target/arm/helper.c +2 -3
index 97bb6b8c01..dc51175bf0 100644
@@ -731,13 +731,12 @@ static void tlbimvaa_is_write(CPUARMState *env, const ARMCPRegInfo *ri,
 
 /*
  * Non-IS variants of TLB operations are upgraded to
- * IS versions if we are at NS EL1 and HCR_EL2.FB is set to
+ * IS versions if we are at EL1 and HCR_EL2.FB is effectively set to
  * force broadcast of these operations.
  */
 static bool tlb_force_broadcast(CPUARMState *env)
 {
-    return (env->cp15.hcr_el2 & HCR_FB) &&
-        arm_current_el(env) == 1 && arm_is_secure_below_el3(env);
+    return arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_FB);
 }
 
 static void tlbiall_write(CPUARMState *env, const ARMCPRegInfo *ri,
Signature · 1 line
2.29.1
#1 lore raw
Quoted 9 lines · On Thu, 29 Oct 2020 at 20:25, <[email protected]> wrote:

From: Rémi Denis-Courmont <[email protected]>

HCR should be applied when NS is set, not when it is cleared.

---
 target/arm/helper.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Applied to target-arm.next, thanks.

Could you cc future patches to qemu-devel as well as qemu-arm, please? The automatic patch-testing/harvesting tools and some people only subscribe to the main list.

-- PMM