diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2018-06-27 15:51:05 +0100 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2018-07-09 11:37:42 +0100 |
commit | 0db9dd8a0fbd5c861737bf2a8a2852e56dbd7ceb (patch) | |
tree | 0af37b0db4492e510c9366f9f3c8c7b16920c680 /arch/arm/include/asm/kvm_mmu.h | |
parent | 88dc25e8ea7c968bbf76d033431e2d7e1418bcd7 (diff) | |
download | talos-obmc-linux-0db9dd8a0fbd5c861737bf2a8a2852e56dbd7ceb.tar.gz talos-obmc-linux-0db9dd8a0fbd5c861737bf2a8a2852e56dbd7ceb.zip |
KVM: arm/arm64: Stop using the kernel's {pmd,pud,pgd}_populate helpers
The {pmd,pud,pgd}_populate accessors usage have always been a bit weird
in KVM. We don't have a struct mm to pass (and neither does the kernel
most of the time, but still...), and the 32bit code has all kind of
cache maintenance that doesn't make sense on ARMv7+ when MP extensions
are mandatory (which is the case when the VEs are present).
Let's bite the bullet and provide our own implementations. The only bit
of architectural code left has to do with building the table entry
itself (arm64 having up to 52bit PA, arm lacking PUD level).
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/include/asm/kvm_mmu.h')
-rw-r--r-- | arch/arm/include/asm/kvm_mmu.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index b2feaea1434c..265ea9cf7df7 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h @@ -75,6 +75,10 @@ phys_addr_t kvm_get_idmap_vector(void); int kvm_mmu_init(void); void kvm_clear_hyp_idmap(void); +#define kvm_mk_pmd(ptep) __pmd(__pa(ptep) | PMD_TYPE_TABLE) +#define kvm_mk_pud(pmdp) __pud(__pa(pmdp) | PMD_TYPE_TABLE) +#define kvm_mk_pgd(pudp) ({ BUILD_BUG(); 0; }) + static inline pte_t kvm_s2pte_mkwrite(pte_t pte) { pte_val(pte) |= L_PTE_S2_RDWR; |