diff options
Diffstat (limited to 'arch/i386/mm/init.c')
-rw-r--r-- | arch/i386/mm/init.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 1b1a1e66d099..4c4809f13cb1 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c | |||
@@ -800,9 +800,17 @@ void mark_rodata_ro(void) | |||
800 | unsigned long start = PFN_ALIGN(_text); | 800 | unsigned long start = PFN_ALIGN(_text); |
801 | unsigned long size = PFN_ALIGN(_etext) - start; | 801 | unsigned long size = PFN_ALIGN(_etext) - start; |
802 | 802 | ||
803 | change_page_attr(virt_to_page(start), | 803 | #ifndef CONFIG_KPROBES |
804 | size >> PAGE_SHIFT, PAGE_KERNEL_RX); | 804 | #ifdef CONFIG_HOTPLUG_CPU |
805 | printk("Write protecting the kernel text: %luk\n", size >> 10); | 805 | /* It must still be possible to apply SMP alternatives. */ |
806 | if (num_possible_cpus() <= 1) | ||
807 | #endif | ||
808 | { | ||
809 | change_page_attr(virt_to_page(start), | ||
810 | size >> PAGE_SHIFT, PAGE_KERNEL_RX); | ||
811 | printk("Write protecting the kernel text: %luk\n", size >> 10); | ||
812 | } | ||
813 | #endif | ||
806 | start += size; | 814 | start += size; |
807 | size = (unsigned long)__end_rodata - start; | 815 | size = (unsigned long)__end_rodata - start; |
808 | change_page_attr(virt_to_page(start), | 816 | change_page_attr(virt_to_page(start), |