diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-10 05:43:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-10 05:43:00 -0400 |
commit | bac0c9103b31c3dd83ad9d731dd9834e2ba75e4f (patch) | |
tree | 702dd6a7ce06d224d594c2293af546b11ac9f51b /arch/x86/mm/init_64.c | |
parent | 6329d3021bcfa9038621e6e917d98929421d8ec8 (diff) | |
parent | 98a05ed4bd7774f533ab185fe0bf2fdc58292d7c (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.c | 10 |
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); | |||
767 | void mark_rodata_ro(void) | 767 | void 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 | ||