summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/kvm_arm.h
diff options
context:
space:
mode:
authorSuzuki K Poulose2018-09-26 18:32:49 +0200
committerMarc Zyngier2018-10-01 14:50:32 +0200
commit13ac4bbcc457d3925b4031cc70e3031fd8b9c3b7 (patch)
tree0dae8da91a6f4a1e128b621b9d69e9702da7fb5d /arch/arm64/include/asm/kvm_arm.h
parentkvm: arm64: Configure VTCR_EL2.SL0 per VM (diff)
downloadkernel-qcow2-linux-13ac4bbcc457d3925b4031cc70e3031fd8b9c3b7.tar.gz
kernel-qcow2-linux-13ac4bbcc457d3925b4031cc70e3031fd8b9c3b7.tar.xz
kernel-qcow2-linux-13ac4bbcc457d3925b4031cc70e3031fd8b9c3b7.zip
kvm: arm64: Switch to per VM IPA limit
Now that we can manage the stage2 page table per VM, switch the configuration details to per VM instance. The VTCR is updated with the values specific to the VM based on the configuration. We store the IPA size and the number of stage2 page table levels for the guest already in VTCR. Decode it back from the vtcr field wherever we need it. Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: 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_arm.h')
-rw-r--r--arch/arm64/include/asm/kvm_arm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index f913adb44f93..e4240568cc18 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -197,6 +197,8 @@
VTCR_EL2_SL0_TO_LVLS(((vtcr) & VTCR_EL2_SL0_MASK) >> VTCR_EL2_SL0_SHIFT)
#define VTCR_EL2_FLAGS (VTCR_EL2_COMMON_BITS | VTCR_EL2_TGRAN)
+#define VTCR_EL2_IPA(vtcr) (64 - ((vtcr) & VTCR_EL2_T0SZ_MASK))
+
/*
* ARM VMSAv8-64 defines an algorithm for finding the translation table
* descriptors in section D4.2.8 in ARM DDI 0487C.a.