diff options
author | Vladimir Murzin <vladimir.murzin@arm.com> | 2018-07-31 16:08:57 +0300 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2018-09-18 14:03:34 +0300 |
commit | ab510027dc4dbd1eeb611a34b0cda8b21fcde492 (patch) | |
tree | 6f71d3b509e910de4db2cebd1b76f33ef11873b7 /arch/arm/include/asm/kvm_arm.h | |
parent | 5ffdfaedfa0aba3f5db0fbb8ed4f3192be2b39b8 (diff) | |
download | linux-ab510027dc4dbd1eeb611a34b0cda8b21fcde492.tar.xz |
arm64: KVM: Enable Common Not Private translations
We rely on cpufeature framework to detect and enable CNP so for KVM we
need to patch hyp to set CNP bit just before TTBR0_EL2 gets written.
For the guest we encode CNP bit while building vttbr, so we don't need
to bother with that in a world switch.
Reviewed-by: James Morse <james.morse@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/include/asm/kvm_arm.h')
-rw-r--r-- | arch/arm/include/asm/kvm_arm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h index 3ab8b3781bfe..2d43dca29c72 100644 --- a/arch/arm/include/asm/kvm_arm.h +++ b/arch/arm/include/asm/kvm_arm.h @@ -161,6 +161,7 @@ #else #define VTTBR_X (5 - KVM_T0SZ) #endif +#define VTTBR_CNP_BIT _AC(1, UL) #define VTTBR_BADDR_MASK (((_AC(1, ULL) << (40 - VTTBR_X)) - 1) << VTTBR_X) #define VTTBR_VMID_SHIFT _AC(48, ULL) #define VTTBR_VMID_MASK(size) (_AT(u64, (1 << size) - 1) << VTTBR_VMID_SHIFT) |