mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
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>
This commit is contained in:
parent
adafdf6a4e
commit
edeed30589
6 changed files with 276 additions and 0 deletions
|
|
@ -184,6 +184,7 @@
|
|||
VMLINUX_SYMBOL(__start___param) = .; \
|
||||
*(__param) \
|
||||
VMLINUX_SYMBOL(__stop___param) = .; \
|
||||
. = ALIGN((align)); \
|
||||
VMLINUX_SYMBOL(__end_rodata) = .; \
|
||||
} \
|
||||
. = ALIGN((align));
|
||||
|
|
|
|||
|
|
@ -47,5 +47,12 @@ void clflush_cache_range(void *addr, int size);
|
|||
#ifdef CONFIG_DEBUG_RODATA
|
||||
void mark_rodata_ro(void);
|
||||
#endif
|
||||
#ifdef CONFIG_DEBUG_RODATA_TEST
|
||||
void rodata_test(void);
|
||||
#else
|
||||
static inline void rodata_test(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue