summaryrefslogtreecommitdiff
path: root/arch/x86/mm/init_64.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 13:34:07 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:34:07 +0100
commitf62d0f008e889915c93631c04d4c7d871f05bea7 (patch)
tree36eb08ed99de278c77ef58df06b282736ff19b08 /arch/x86/mm/init_64.c
parentd806e5ee20f62a892b09aa59559f143d465285db (diff)
x86: cpa: set_memory_notpresent()
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r--arch/x86/mm/init_64.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 05bb12db0b09..4757be7b5e55 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -559,8 +559,21 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
free_page(addr);
totalram_pages++;
}
- if (addr > __START_KERNEL_map)
- global_flush_tlb();
+#ifdef CONFIG_DEBUG_RODATA
+ /*
+ * This will make the __init pages not present and
+ * not executable, so that any attempt to use a
+ * __init function from now on will fault immediately
+ * rather than supriously later when memory gets reused.
+ *
+ * We only do this for DEBUG_RODATA to not break up the
+ * 2Mb kernel mapping just for this debug feature.
+ */
+ if (begin >= __START_KERNEL_map) {
+ set_memory_np(begin, (end - begin)/PAGE_SIZE);
+ set_memory_nx(begin, (end - begin)/PAGE_SIZE);
+ }
+#endif
}
void free_initmem(void)