diff options
author | Suzuki K Poulose <suzuki.poulose@arm.com> | 2018-09-26 17:32:43 +0100 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2018-10-01 13:50:29 +0100 |
commit | 7665f3a8491b0ed3c6f65c0bc3a5424ea8f87731 (patch) | |
tree | 2521cc98acc3bd7c5a307d6814bcabf7433fc0e7 /arch/arm64/include/asm/kvm_hyp.h | |
parent | 5b6c6742b5350a6fb5c631fb99a6bc046a62739c (diff) | |
download | linux-stable-7665f3a8491b0ed3c6f65c0bc3a5424ea8f87731.tar.gz linux-stable-7665f3a8491b0ed3c6f65c0bc3a5424ea8f87731.tar.bz2 linux-stable-7665f3a8491b0ed3c6f65c0bc3a5424ea8f87731.zip |
kvm: arm64: Configure VTCR_EL2 per VM
Add support for setting the VTCR_EL2 per VM, rather than hard
coding a value at boot time per CPU. This would allow us to tune
the stage2 page table parameters per VM in the later changes.
We compute the VTCR fields based on the system wide sanitised
feature registers, except for the hardware management of Access
Flags (VTCR_EL2.HA). It is fine to run a system with a mix of
CPUs that may or may not update the page table Access Flags.
Since the bit is RES0 on CPUs that don't support it, the bit
should be ignored on them.
Suggested-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <cdall@kernel.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/kvm_hyp.h')
-rw-r--r-- | arch/arm64/include/asm/kvm_hyp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_hyp.h b/arch/arm64/include/asm/kvm_hyp.h index d1bd1e0f14d7..23aca66767f9 100644 --- a/arch/arm64/include/asm/kvm_hyp.h +++ b/arch/arm64/include/asm/kvm_hyp.h @@ -161,6 +161,7 @@ void __noreturn __hyp_do_panic(unsigned long, ...); */ static __always_inline void __hyp_text __load_guest_stage2(struct kvm *kvm) { + write_sysreg(kvm->arch.vtcr, vtcr_el2); write_sysreg(kvm->arch.vttbr, vttbr_el2); } |