summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_64.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2008-01-30 13:34:08 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:34:08 +0100
commitedeed30589f5defe63ce6aaae56f2b7c855e4520 (patch)
treea49736ff74dcbd3feba3c8318b204fb2165f892d /arch/x86/mm/init_64.c
parentadafdf6a4e45f2d1051e10aebe13025e89dbdf6d (diff)
downloadblackbird-op-linux-edeed30589f5defe63ce6aaae56f2b7c855e4520.tar.gz
blackbird-op-linux-edeed30589f5defe63ce6aaae56f2b7c855e4520.zip
x86: add testcases for RODATA and NX protections/attributes
Latest update; I now have 4 NX tests, but 2 fail so they're #if 0'd. I also cleaned up the NX test code quite a bit, and got rid of the ugly exception table sorting stuff. From: Arjan van de Ven <arjan@linux.intel.com> This patch adds testcases for the CONFIG_DEBUG_RODATA configuration option as well as the NX CPU feature/mappings. Both testcases can move to tests/ once that patch gets merged into mainline. (I'm half considering moving the rodata test into mm/init.c but I'll wait with that until init.c is unified) As part of this I had to fix a not-quite-right alignment in the vmlinux.lds.h for the RODATA sections, which lead to 1 page less being marked read only. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> 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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index f97ace7a55e5..50d29f5da02b 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -573,6 +573,7 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
set_memory_rw(begin, (end - begin)/PAGE_SIZE);
set_memory_np(begin, (end - begin)/PAGE_SIZE);
set_memory_nx(begin, (end - begin)/PAGE_SIZE);
+ rodata_test();
}
#endif
}
@@ -585,6 +586,8 @@ void free_initmem(void)
}
#ifdef CONFIG_DEBUG_RODATA
+const int rodata_test_data = 0xC3;
+EXPORT_SYMBOL_GPL(rodata_test_data);
void mark_rodata_ro(void)
{
OpenPOWER on IntegriCloud