From: Tang Chen Date: Thu, 7 Feb 2013 01:26:28 +0000 (+1100) Subject: memory-hotplug: remove page table of x86_64 architecture X-Git-Tag: next-20130218~1^2~446 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=13c837d0c3404cca29a29045c23260a59de9c8cb;p=karo-tx-linux.git memory-hotplug: remove page table of x86_64 architecture Search a page table about the removed memory, and clear page table for x86_64 architecture. Signed-off-by: Wen Congyang Signed-off-by: Jianguo Wu Signed-off-by: Jiang Liu Signed-off-by: Tang Chen Cc: KOSAKI Motohiro Cc: Kamezawa Hiroyuki Cc: Lai Jiangshan Cc: Wu Jianguo Cc: Yasuaki Ishimatsu Cc: Ingo Molnar Cc: Thomas Gleixner Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton --- diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index ca6cd403a275..37a510dd73b6 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1011,6 +1011,15 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct) flush_tlb_all(); } +void __meminit +kernel_physical_mapping_remove(unsigned long start, unsigned long end) +{ + start = (unsigned long)__va(start); + end = (unsigned long)__va(end); + + remove_pagetable(start, end, true); +} + #ifdef CONFIG_MEMORY_HOTREMOVE int __ref arch_remove_memory(u64 start, u64 size) { @@ -1020,6 +1029,7 @@ int __ref arch_remove_memory(u64 start, u64 size) int ret; zone = page_zone(pfn_to_page(start_pfn)); + kernel_physical_mapping_remove(start, start + size); ret = __remove_pages(zone, start_pfn, nr_pages); WARN_ON_ONCE(ret);