diff options
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r-- | arch/x86/mm/init_32.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 029e8cffca9e..9689a5138e64 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -1035,6 +1035,8 @@ void mark_rodata_ro(void) | |||
1035 | unsigned long start = PFN_ALIGN(_text); | 1035 | unsigned long start = PFN_ALIGN(_text); |
1036 | unsigned long size = PFN_ALIGN(_etext) - start; | 1036 | unsigned long size = PFN_ALIGN(_etext) - start; |
1037 | 1037 | ||
1038 | #ifndef CONFIG_DYNAMIC_FTRACE | ||
1039 | /* Dynamic tracing modifies the kernel text section */ | ||
1038 | set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); | 1040 | set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); |
1039 | printk(KERN_INFO "Write protecting the kernel text: %luk\n", | 1041 | printk(KERN_INFO "Write protecting the kernel text: %luk\n", |
1040 | size >> 10); | 1042 | size >> 10); |
@@ -1047,6 +1049,8 @@ void mark_rodata_ro(void) | |||
1047 | printk(KERN_INFO "Testing CPA: write protecting again\n"); | 1049 | printk(KERN_INFO "Testing CPA: write protecting again\n"); |
1048 | set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT); | 1050 | set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT); |
1049 | #endif | 1051 | #endif |
1052 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
1053 | |||
1050 | start += size; | 1054 | start += size; |
1051 | size = (unsigned long)__end_rodata - start; | 1055 | size = (unsigned long)__end_rodata - start; |
1052 | set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); | 1056 | set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); |