aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pageattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r--arch/x86/mm/pageattr.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index e2a74ea11a53..464d8fc21ce6 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -899,7 +899,24 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
899 */ 899 */
900 cpa_fill_pool(); 900 cpa_fill_pool();
901} 901}
902#endif 902
903#ifdef CONFIG_HIBERNATION
904
905bool kernel_page_present(struct page *page)
906{
907 unsigned int level;
908 pte_t *pte;
909
910 if (PageHighMem(page))
911 return false;
912
913 pte = lookup_address((unsigned long)page_address(page), &level);
914 return (pte_val(*pte) & _PAGE_PRESENT);
915}
916
917#endif /* CONFIG_HIBERNATION */
918
919#endif /* CONFIG_DEBUG_PAGEALLOC */
903 920
904/* 921/*
905 * The testcases use internal knowledge of the implementation that shouldn't 922 * The testcases use internal knowledge of the implementation that shouldn't