diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-02-20 03:47:44 +0300 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-21 10:15:28 +0300 |
commit | 8a235efad548abd2ab5ebea45a9ffa750c814375 (patch) | |
tree | 9b8c6c1fa3d2e28d9bb198d7019cba8883d5299e /arch/x86/mm/pageattr.c | |
parent | e80af3a8dbbbf431b2070cc760699f01c5a6ac69 (diff) | |
download | linux-8a235efad548abd2ab5ebea45a9ffa750c814375.tar.xz |
Hibernation: Handle DEBUG_PAGEALLOC on x86
Make hibernation work with CONFIG_DEBUG_PAGEALLOC set on x86, by
checking if the pages to be copied are marked as present in the
kernel mapping and temporarily marking them as present if that's not
the case. No functional modifications are introduced if
CONFIG_DEBUG_PAGEALLOC is unset.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r-- | arch/x86/mm/pageattr.c | 19 |
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) */ cpa_fill_pool(); } -#endif + +#ifdef CONFIG_HIBERNATION + +bool kernel_page_present(struct page *page) +{ + unsigned int level; + pte_t *pte; + + if (PageHighMem(page)) + return false; + + pte = lookup_address((unsigned long)page_address(page), &level); + return (pte_val(*pte) & _PAGE_PRESENT); +} + +#endif /* CONFIG_HIBERNATION */ + +#endif /* CONFIG_DEBUG_PAGEALLOC */ /* * The testcases use internal knowledge of the implementation that shouldn't |