diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2009-09-22 19:45:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:41 -0400 |
commit | 9492587cf35d370db33ef4b38375dfb35a105b61 (patch) | |
tree | 59daaf91e847d3c5cd6f542626da75db5814b06d /arch/x86 | |
parent | a0614da88b67ffa3dbcc0d40b817e682c7c4a0ee (diff) |
kcore: register text area in generic way
Some 64bit arch has special segment for mapping kernel text. It should be
entried to /proc/kcore in addtion to direct-linear-map, vmalloc area.
This patch unifies KCORE_TEXT entry scattered under x86 and ia64.
I'm not familiar with other archs (mips has its own even after this patch)
but range of [_stext ..._end) is a valid area of text and it's not in
direct-map area, defining CONFIG_ARCH_PROC_KCORE_TEXT is only a necessary
thing to do.
Note: I left mips as it is now.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86/mm/init_64.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e4ff5d1280ca..7c7a54bed4a6 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1204,6 +1204,10 @@ config ARCH_DISCONTIGMEM_DEFAULT | |||
1204 | def_bool y | 1204 | def_bool y |
1205 | depends on NUMA && X86_32 | 1205 | depends on NUMA && X86_32 |
1206 | 1206 | ||
1207 | config ARCH_PROC_KCORE_TEXT | ||
1208 | def_bool y | ||
1209 | depends on X86_64 && PROC_KCORE | ||
1210 | |||
1207 | config ARCH_SPARSEMEM_DEFAULT | 1211 | config ARCH_SPARSEMEM_DEFAULT |
1208 | def_bool y | 1212 | def_bool y |
1209 | depends on X86_64 | 1213 | depends on X86_64 |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index da2cae7427a6..a0c2efb10cbe 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -647,8 +647,7 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | |||
647 | 647 | ||
648 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 648 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
649 | 649 | ||
650 | static struct kcore_list kcore_mem, kcore_kernel, | 650 | static struct kcore_list kcore_mem, kcore_modules, kcore_vsyscall; |
651 | kcore_modules, kcore_vsyscall; | ||
652 | 651 | ||
653 | void __init mem_init(void) | 652 | void __init mem_init(void) |
654 | { | 653 | { |
@@ -678,7 +677,6 @@ void __init mem_init(void) | |||
678 | 677 | ||
679 | /* Register memory areas for /proc/kcore */ | 678 | /* Register memory areas for /proc/kcore */ |
680 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT, KCORE_RAM); | 679 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT, KCORE_RAM); |
681 | kclist_add(&kcore_kernel, &_stext, _end - _stext, KCORE_TEXT); | ||
682 | kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_LEN, | 680 | kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_LEN, |
683 | KCORE_OTHER); | 681 | KCORE_OTHER); |
684 | kclist_add(&kcore_vsyscall, (void *)VSYSCALL_START, | 682 | kclist_add(&kcore_vsyscall, (void *)VSYSCALL_START, |