kvm-arm: arm64: Introduce hyp page table empty checks
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 22 Mar 2016 17:20:28 +0000 (17:20 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 21 Apr 2016 12:57:56 +0000 (14:57 +0200)
Introduce hyp_pxx_table_empty helpers for checking whether
a given table entry is empty. This will be used explicitly
once we switch to explicit routines for hyp page table walk.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
arch/arm64/include/asm/kvm_mmu.h

index e3f53e3eb4d924e32fa315675602e8f08a784969..edf3c62c660ede8d0330da2538b49a328fcc48e0 100644 (file)
@@ -249,6 +249,20 @@ static inline bool kvm_page_empty(void *ptr)
 #endif
 
 
+#define hyp_pte_table_empty(ptep) kvm_page_empty(ptep)
+
+#ifdef __PAGETABLE_PMD_FOLDED
+#define hyp_pmd_table_empty(pmdp) (0)
+#else
+#define hyp_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
+#endif
+
+#ifdef __PAGETABLE_PUD_FOLDED
+#define hyp_pud_table_empty(pudp) (0)
+#else
+#define hyp_pud_table_empty(pudp) kvm_page_empty(pudp)
+#endif
+
 struct kvm;
 
 #define kvm_flush_dcache_to_poc(a,l)   __flush_dcache_area((a), (l))