@@ -1472,9 +1472,6 @@ static inline bool pgdp_maps_userspace(void *__ptr)
return (((ptr & ~PAGE_MASK) / sizeof(pgd_t)) < PGD_KERNEL_START);
}
-#define pgd_leaf pgd_leaf
-static inline bool pgd_leaf(pgd_t pgd) { return false; }
-
#ifdef CONFIG_MITIGATION_PAGE_TABLE_ISOLATION
/*
* All top-level MITIGATION_PAGE_TABLE_ISOLATION page tables are order-1 pages
@@ -185,7 +185,7 @@ static p4d_t *pti_user_pagetable_walk_p4d(unsigned long address)
set_pgd(pgd, __pgd(_KERNPG_TABLE | __pa(new_p4d_page)));
}
- BUILD_BUG_ON(pgd_leaf(*pgd) != 0);
+ BUILD_BUG_ON(pgd_leaf(*pgd));
return p4d_offset(pgd, address);
}
pgd huge page is not supported yet, let's use the generic definition in linux/pgtable.h. And also update the BUILD_BUG_ON() checking for pgd_leaf() in pti_user_pagetable_walk_p4d() because pgd_leaf() returns boolean value. Signed-off-by: Baoquan He <bhe@redhat.com> --- arch/x86/include/asm/pgtable.h | 3 --- arch/x86/mm/pti.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-)