Skip to content

Commit d9f943f

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Mark HCR.EL2.E2H RES0 when ID_AA64MMFR1_EL1.VH is zero
Enforce HCR_EL2.E2H being RES0 when VHE is disabled, so that we can actually rely on that bit never being flipped behind our back. Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Joey Gouly <joey.gouly@arm.com> Link: https://lore.kernel.org/r/20250220134907.554085-4-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent 9d67455 commit d9f943f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm64/kvm/nested.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,8 @@ int kvm_init_nv_sysregs(struct kvm_vcpu *vcpu)
10341034
res0 |= (HCR_TEA | HCR_TERR);
10351035
if (!kvm_has_feat(kvm, ID_AA64MMFR1_EL1, LO, IMP))
10361036
res0 |= HCR_TLOR;
1037+
if (!kvm_has_feat(kvm, ID_AA64MMFR1_EL1, VH, IMP))
1038+
res0 |= HCR_E2H;
10371039
if (!kvm_has_feat(kvm, ID_AA64MMFR4_EL1, E2H0, IMP))
10381040
res1 |= HCR_E2H;
10391041
set_sysreg_masks(kvm, HCR_EL2, res0, res1);

0 commit comments

Comments
 (0)