diff options
Diffstat (limited to 'arch/arm64/include/asm/kvm_mmu.h')
-rw-r--r-- | arch/arm64/include/asm/kvm_mmu.h | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index 8e138c7c53ac..a030d163840b 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h | |||
@@ -59,10 +59,9 @@ | |||
59 | #define KERN_TO_HYP(kva) ((unsigned long)kva - PAGE_OFFSET + HYP_PAGE_OFFSET) | 59 | #define KERN_TO_HYP(kva) ((unsigned long)kva - PAGE_OFFSET + HYP_PAGE_OFFSET) |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * Align KVM with the kernel's view of physical memory. Should be | 62 | * We currently only support a 40bit IPA. |
63 | * 40bit IPA, with PGD being 8kB aligned in the 4KB page configuration. | ||
64 | */ | 63 | */ |
65 | #define KVM_PHYS_SHIFT PHYS_MASK_SHIFT | 64 | #define KVM_PHYS_SHIFT (40) |
66 | #define KVM_PHYS_SIZE (1UL << KVM_PHYS_SHIFT) | 65 | #define KVM_PHYS_SIZE (1UL << KVM_PHYS_SHIFT) |
67 | #define KVM_PHYS_MASK (KVM_PHYS_SIZE - 1UL) | 66 | #define KVM_PHYS_MASK (KVM_PHYS_SIZE - 1UL) |
68 | 67 | ||
@@ -93,19 +92,6 @@ void kvm_clear_hyp_idmap(void); | |||
93 | #define kvm_set_pte(ptep, pte) set_pte(ptep, pte) | 92 | #define kvm_set_pte(ptep, pte) set_pte(ptep, pte) |
94 | #define kvm_set_pmd(pmdp, pmd) set_pmd(pmdp, pmd) | 93 | #define kvm_set_pmd(pmdp, pmd) set_pmd(pmdp, pmd) |
95 | 94 | ||
96 | static inline bool kvm_is_write_fault(unsigned long esr) | ||
97 | { | ||
98 | unsigned long esr_ec = esr >> ESR_EL2_EC_SHIFT; | ||
99 | |||
100 | if (esr_ec == ESR_EL2_EC_IABT) | ||
101 | return false; | ||
102 | |||
103 | if ((esr & ESR_EL2_ISV) && !(esr & ESR_EL2_WNR)) | ||
104 | return false; | ||
105 | |||
106 | return true; | ||
107 | } | ||
108 | |||
109 | static inline void kvm_clean_pgd(pgd_t *pgd) {} | 95 | static inline void kvm_clean_pgd(pgd_t *pgd) {} |
110 | static inline void kvm_clean_pmd_entry(pmd_t *pmd) {} | 96 | static inline void kvm_clean_pmd_entry(pmd_t *pmd) {} |
111 | static inline void kvm_clean_pte(pte_t *pte) {} | 97 | static inline void kvm_clean_pte(pte_t *pte) {} |