From: Marc Zyngier Date: Fri, 9 Jun 2023 16:21:53 +0000 (+0100) Subject: KVM: arm64: Force HCR_EL2.E2H when ARM64_KVM_HVHE is set X-Git-Tag: v6.6.7~2444^2~7^2~5^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0daf5a21e635057e87cc05d6bca012157aa3ab7;p=platform%2Fkernel%2Flinux-starfive.git 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 Link: https://lore.kernel.org/r/20230609162200.2024064-11-maz@kernel.org Signed-off-by: Oliver Upton --- diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 1439182..c12276d 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -1676,6 +1676,8 @@ static void __init cpu_prepare_hyp_mode(int cpu, u32 hyp_va_bits) params->hcr_el2 = HCR_HOST_NVHE_PROTECTED_FLAGS; else params->hcr_el2 = HCR_HOST_NVHE_FLAGS; + if (cpus_have_final_cap(ARM64_KVM_HVHE)) + params->hcr_el2 |= HCR_E2H; params->vttbr = params->vtcr = 0; /*