aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_64.c
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-02-02 15:42:20 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:58 -0400
commit4e4eee0e0139811b36a07854dcfa9746bc8b16d3 (patch)
treea9386a0816fe40cec4fae524759dc7cb93f46725 /arch/x86/mm/init_64.c
parente587cadd8f47e202a30712e2906a65a0606d5865 (diff)
x86: enhance DEBUG_RODATA support for hotplug and kprobes
Standardize DEBUG_RODATA, removing special cases for hotplug and kprobes. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Andi Kleen <andi@firstfloor.org> Cc: pageexec@freemail.hu Cc: akpm@linux-foundation.org CC: Andi Kleen <andi@firstfloor.org> CC: pageexec@freemail.hu CC: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r--arch/x86/mm/init_64.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index ae66d8d4c58d..4cb6c7f80f07 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -635,24 +635,7 @@ EXPORT_SYMBOL_GPL(rodata_test_data);
635 635
636void mark_rodata_ro(void) 636void mark_rodata_ro(void)
637{ 637{
638 unsigned long start = (unsigned long)_stext, end; 638 unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata);
639
640#ifdef CONFIG_HOTPLUG_CPU
641 /* It must still be possible to apply SMP alternatives. */
642 if (num_possible_cpus() > 1)
643 start = (unsigned long)_etext;
644#endif
645
646#ifdef CONFIG_KPROBES
647 start = (unsigned long)__start_rodata;
648#endif
649
650 end = (unsigned long)__end_rodata;
651 start = (start + PAGE_SIZE - 1) & PAGE_MASK;
652 end &= PAGE_MASK;
653 if (end <= start)
654 return;
655
656 639
657 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", 640 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
658 (end - start) >> 10); 641 (end - start) >> 10);
@@ -675,6 +658,7 @@ void mark_rodata_ro(void)
675 set_memory_ro(start, (end-start) >> PAGE_SHIFT); 658 set_memory_ro(start, (end-start) >> PAGE_SHIFT);
676#endif 659#endif
677} 660}
661
678#endif 662#endif
679 663
680#ifdef CONFIG_BLK_DEV_INITRD 664#ifdef CONFIG_BLK_DEV_INITRD