target/arm: fix handling of HCR.FB

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

Backports 373e7ffde9bae90a20fb5db21b053f23091689f4
This commit is contained in:
Rémi Denis-Courmont 2021-03-02 13:04:51 -05:00 committed by Lioncash
parent 6b8096d9fc
commit df4413edc7

View file

@ -471,13 +471,12 @@ static void tlbimvaa_is_write(CPUARMState *env, const ARMCPRegInfo *ri,
/* /*
* Non-IS variants of TLB operations are upgraded to * 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. * force broadcast of these operations.
*/ */
static bool tlb_force_broadcast(CPUARMState *env) static bool tlb_force_broadcast(CPUARMState *env)
{ {
return (env->cp15.hcr_el2 & HCR_FB) && return arm_current_el(env) == 1 && (arm_hcr_el2_eff(env) & HCR_FB);
arm_current_el(env) == 1 && arm_is_secure_below_el3(env);
} }
static void tlbiall_write(CPUARMState *env, const ARMCPRegInfo *ri, static void tlbiall_write(CPUARMState *env, const ARMCPRegInfo *ri,