[POWERPC] Fix kernel panic in arch_arm_kprobe
authorIonut Nicu <ionut.nicu@freescale.com>
Wed, 5 Mar 2008 16:12:54 +0000 (03:12 +1100)
committerPaul Mackerras <paulus@samba.org>
Mon, 7 Apr 2008 03:49:19 +0000 (13:49 +1000)
The code in arch_arm_kprobe was trying to set a breakpoint which
resulted in a page fault because the kernel text pages were write
protected.  Disable the write protect when CONFIG_KPROBES is defined.

Signed-off-by: Ionut Nicu <ionut.nicu@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
include/asm-powerpc/pgtable-ppc32.h

index 2c79f550272bf08bade81d3ec7cd3eb88e02895a..bd5b4011c53be7cf6747674271cae1f4218d9ec8 100644 (file)
@@ -420,7 +420,8 @@ extern int icache_44x_need_flush;
 #define _PAGE_IO       (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED)
 #define _PAGE_RAM      (_PAGE_KERNEL | _PAGE_HWEXEC)
 
-#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH)
+#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
+       defined(CONFIG_KPROBES)
 /* We want the debuggers to be able to set breakpoints anywhere, so
  * don't write protect the kernel text */
 #define _PAGE_RAM_TEXT _PAGE_RAM