diff options
-rw-r--r-- | arch/x86/mm/pageattr_64.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c index 4053832d4108..e1c860800ff1 100644 --- a/arch/x86/mm/pageattr_64.c +++ b/arch/x86/mm/pageattr_64.c | |||
@@ -260,3 +260,33 @@ void global_flush_tlb(void) | |||
260 | on_each_cpu(flush_kernel_map, NULL, 1, 1); | 260 | on_each_cpu(flush_kernel_map, NULL, 1, 1); |
261 | } | 261 | } |
262 | EXPORT_SYMBOL(global_flush_tlb); | 262 | EXPORT_SYMBOL(global_flush_tlb); |
263 | |||
264 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
265 | void kernel_map_pages(struct page *page, int numpages, int enable) | ||
266 | { | ||
267 | if (PageHighMem(page)) | ||
268 | return; | ||
269 | if (!enable) { | ||
270 | debug_check_no_locks_freed(page_address(page), | ||
271 | numpages * PAGE_SIZE); | ||
272 | } | ||
273 | |||
274 | /* | ||
275 | * If page allocator is not up yet then do not call c_p_a(): | ||
276 | */ | ||
277 | if (!debug_pagealloc_enabled) | ||
278 | return; | ||
279 | |||
280 | /* | ||
281 | * the return value is ignored - the calls cannot fail, | ||
282 | * large pages are disabled at boot time. | ||
283 | */ | ||
284 | change_page_attr(page, numpages, enable ? PAGE_KERNEL : __pgprot(0)); | ||
285 | |||
286 | /* | ||
287 | * we should perform an IPI and flush all tlbs, | ||
288 | * but that can deadlock->flush only current cpu. | ||
289 | */ | ||
290 | __flush_tlb_all(); | ||
291 | } | ||
292 | #endif | ||