diff options
author | Vladimir Murzin <vladimir.murzin@arm.com> | 2015-11-16 11:28:18 +0000 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2015-12-18 10:15:12 +0000 |
commit | 20475f784d29991b3b843c80c38a36f2ebb35ac4 (patch) | |
tree | fce9116aeb5f04122e323a240daeb5a018feb360 /arch/arm/include | |
parent | 8420dcd37ef34040c8fc5a27bf66887b3b2faf80 (diff) | |
download | op-kernel-dev-20475f784d29991b3b843c80c38a36f2ebb35ac4.zip op-kernel-dev-20475f784d29991b3b843c80c38a36f2ebb35ac4.tar.gz |
arm64: KVM: Add support for 16-bit VMID
The ARMv8.1 architecture extension allows to choose between 8-bit and
16-bit of VMID, so use this capability for KVM.
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/kvm_arm.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/kvm_mmu.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h index 01d4d7a..e22089f 100644 --- a/arch/arm/include/asm/kvm_arm.h +++ b/arch/arm/include/asm/kvm_arm.h @@ -164,7 +164,7 @@ #define VTTBR_BADDR_SHIFT (VTTBR_X - 1) #define VTTBR_BADDR_MASK (((_AC(1, ULL) << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT) #define VTTBR_VMID_SHIFT _AC(48, ULL) -#define VTTBR_VMID_MASK (_AC(0xff, ULL) << VTTBR_VMID_SHIFT) +#define VTTBR_VMID_MASK(size) (_AT(u64, (1 << size) - 1) << VTTBR_VMID_SHIFT) /* Hyp Syndrome Register (HSR) bits */ #define HSR_EC_SHIFT (26) diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index 405aa18..9203c21 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h @@ -279,6 +279,11 @@ static inline void __kvm_extend_hypmap(pgd_t *boot_hyp_pgd, pgd_t *merged_hyp_pgd, unsigned long hyp_idmap_start) { } +static inline unsigned int kvm_get_vmid_bits(void) +{ + return 8; +} + #endif /* !__ASSEMBLY__ */ #endif /* __ARM_KVM_MMU_H__ */ |