diff options
author | Marc Zyngier <maz@kernel.org> | 2023-06-09 19:21:53 +0300 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2023-06-13 02:17:23 +0300 |
commit | d0daf5a21e635057e87cc05d6bca012157aa3ab7 (patch) | |
tree | 5a293b0d4db71546246aa79f5205e30d9c1c5e92 /arch/arm64/kvm | |
parent | 6f617d3aa643e4ed6929f5b582759f4a73804034 (diff) | |
download | linux-d0daf5a21e635057e87cc05d6bca012157aa3ab7.tar.xz |
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>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r-- | arch/arm64/kvm/arm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 14391826241c..c12276dd2cf4 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; /* |