From 0864a4e201b1ea442f4c8b887418a29f67e24d30 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Wed, 20 Jun 2007 22:23:21 -0700 Subject: Allow DEBUG_RODATA and KPROBES to co-exist Do not mark the kernel text read only if KPROBES is in the kernel; kprobes needs to hot-patch the kernel text to insert it's instrumentation. In this case, only mark the .rodata segment as read only. Signed-off-by: Arjan van de Ven Tested-by: S. P. Prasanna Cc: Andi Kleen Cc: William Cohen Cc: Ian McDonald Signed-off-by: Linus Torvalds --- arch/x86_64/mm/init.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/x86_64/mm/init.c') diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index efb6e845114..9a0e98accf0 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c @@ -605,6 +605,11 @@ void mark_rodata_ro(void) if (num_possible_cpus() > 1) start = (unsigned long)_etext; #endif + +#ifdef CONFIG_KPROBES + start = (unsigned long)__start_rodata; +#endif + end = (unsigned long)__end_rodata; start = (start + PAGE_SIZE - 1) & PAGE_MASK; end &= PAGE_MASK; -- cgit v1.2.3