aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_64.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-10 05:43:00 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-10 05:43:00 -0400
commitbac0c9103b31c3dd83ad9d731dd9834e2ba75e4f (patch)
tree702dd6a7ce06d224d594c2293af546b11ac9f51b /arch/x86/mm/init_64.c
parent6329d3021bcfa9038621e6e917d98929421d8ec8 (diff)
parent98a05ed4bd7774f533ab185fe0bf2fdc58292d7c (diff)
Merge branch 'tracing/ftrace' into auto-ftrace-next
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r--arch/x86/mm/init_64.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 819dad973b13..17c0a6138a53 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -767,6 +767,13 @@ EXPORT_SYMBOL_GPL(rodata_test_data);
767void mark_rodata_ro(void) 767void mark_rodata_ro(void)
768{ 768{
769 unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata); 769 unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata);
770 unsigned long rodata_start =
771 ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
772
773#ifdef CONFIG_DYNAMIC_FTRACE
774 /* Dynamic tracing modifies the kernel text section */
775 start = rodata_start;
776#endif
770 777
771 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", 778 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
772 (end - start) >> 10); 779 (end - start) >> 10);
@@ -776,8 +783,7 @@ void mark_rodata_ro(void)
776 * The rodata section (but not the kernel text!) should also be 783 * The rodata section (but not the kernel text!) should also be
777 * not-executable. 784 * not-executable.
778 */ 785 */
779 start = ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK; 786 set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
780 set_memory_nx(start, (end - start) >> PAGE_SHIFT);
781 787
782 rodata_test(); 788 rodata_test();
783 789