Add the missing forwarding of TCR_EL2.HA to TCR_EL1.HA, which are different bit indices, to ensure that FEAT_HAF actually works for an L1 hypervisor in the EL2 translation regime. Cc: stable@vger.kernel.org Fixes: d5bbb76f4474 ("KVM: arm64: nv: Expose hardware access flag management to NV guests") Signed-off-by: Oliver Upton --- Spinning this off from the HAFDBS series since this fixes an issue with FEAT_HAF which is already supported in NV. arch/arm64/include/asm/kvm_nested.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_nested.h b/arch/arm64/include/asm/kvm_nested.h index 0f899addafa8..2811ec466d88 100644 --- a/arch/arm64/include/asm/kvm_nested.h +++ b/arch/arm64/include/asm/kvm_nested.h @@ -29,7 +29,8 @@ static inline u64 translate_tcr_el2_to_tcr_el1(u64 tcr) (tcr & TCR_EL2_TG0_MASK) | (tcr & TCR_EL2_ORGN0_MASK) | (tcr & TCR_EL2_IRGN0_MASK) | - (tcr & TCR_EL2_T0SZ_MASK); + (tcr & TCR_EL2_T0SZ_MASK) | + ((tcr & TCR_EL2_HA) ? TCR_HA : 0); } static inline u64 translate_cptr_el2_to_cpacr_el1(u64 cptr_el2) base-commit: 9e9283e4c941e806d2735f09b66763487bc48b50 -- 2.47.3