diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-14 10:11:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-14 10:11:52 -0400 |
commit | 5806b81ac1c0c52665b91723fd4146a4f86e386b (patch) | |
tree | 24ea8763bf308ce1407c1de91dc8de4d2655e1c1 /arch/x86/mm/init_64.c | |
parent | d14c8a680ccfdeb5e7b9be4d61162c2b373bd1e8 (diff) | |
parent | 6712e299b7dc78aa4971b85e803435ee6d49a9dd (diff) |
Merge branch 'auto-ftrace-next' into tracing/for-linus
Conflicts:
arch/x86/kernel/entry_32.S
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/lib/Makefile
include/asm-x86/irqflags.h
kernel/Makefile
kernel/sched.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 a25cc6fa2207..27de2435e008 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -991,6 +991,13 @@ EXPORT_SYMBOL_GPL(rodata_test_data); | |||
991 | void mark_rodata_ro(void) | 991 | void mark_rodata_ro(void) |
992 | { | 992 | { |
993 | unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata); | 993 | unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata); |
994 | unsigned long rodata_start = | ||
995 | ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK; | ||
996 | |||
997 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
998 | /* Dynamic tracing modifies the kernel text section */ | ||
999 | start = rodata_start; | ||
1000 | #endif | ||
994 | 1001 | ||
995 | printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", | 1002 | printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", |
996 | (end - start) >> 10); | 1003 | (end - start) >> 10); |
@@ -1000,8 +1007,7 @@ void mark_rodata_ro(void) | |||
1000 | * The rodata section (but not the kernel text!) should also be | 1007 | * The rodata section (but not the kernel text!) should also be |
1001 | * not-executable. | 1008 | * not-executable. |
1002 | */ | 1009 | */ |
1003 | start = ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK; | 1010 | set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT); |
1004 | set_memory_nx(start, (end - start) >> PAGE_SHIFT); | ||
1005 | 1011 | ||
1006 | rodata_test(); | 1012 | rodata_test(); |
1007 | 1013 | ||