[PATCH] powerpc: Fix oops when loading modules

Paul Mackerras paulus at samba.org
Tue Apr 7 13:21:10 EST 2009

This fixes a problem reported by Sean MacLennan where loading any
module would cause an oops.  We weren't marking the pages containing
the module text as having hardware execute permission, due to a bug
introduced in commit 8d1cf34e ("powerpc/mm: Tweak PTE bit combination
definitions"), hence trying to execute the module text caused an
exception on processors that support hardware execute permission.

This adds _PAGE_HWEXEC to the definitions of PAGE_KERNEL_X and
PAGE_KERNEL_ROX to fix this problem.

Reported-by: Sean MacLennan <smaclennan at pikatech.com>
Signed-off-by: Paul Mackerras <paulus at samba.org>
 arch/powerpc/include/asm/pte-common.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/pte-common.h b/arch/powerpc/include/asm/pte-common.h
index d9740e8..a7e210b 100644
--- a/arch/powerpc/include/asm/pte-common.h
+++ b/arch/powerpc/include/asm/pte-common.h
@@ -151,9 +151,11 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
 /* Protection used for kernel text. We want the debuggers to be able to
  * set breakpoints anywhere, so don't write protect the kernel text

More information about the Linuxppc-dev mailing list