Skip to content

Commit d0daf5a

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Force HCR_EL2.E2H when ARM64_KVM_HVHE is set
Obviously, in order to be able to use VHE whilst at EL2, we need to set HCR_EL2.E2H. Do so when ARM64_KVM_HVHE is set. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230609162200.2024064-11-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent 6f617d3 commit d0daf5a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/arm64/kvm/arm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,8 @@ static void __init cpu_prepare_hyp_mode(int cpu, u32 hyp_va_bits)
16761676
params->hcr_el2 = HCR_HOST_NVHE_PROTECTED_FLAGS;
16771677
else
16781678
params->hcr_el2 = HCR_HOST_NVHE_FLAGS;
1679+
if (cpus_have_final_cap(ARM64_KVM_HVHE))
1680+
params->hcr_el2 |= HCR_E2H;
16791681
params->vttbr = params->vtcr = 0;
16801682

16811683
/*

0 commit comments

Comments
 (0)