* [PATCH] powerpc: Fix oops when loading modules
@ 2009-04-07 3:21 Paul Mackerras
2009-04-07 12:19 ` Geert Uytterhoeven
0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2009-04-07 3:21 UTC (permalink / raw)
To: linuxppc-dev
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@pikatech.com>
Signed-off-by: Paul Mackerras <paulus@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);
_PAGE_NO_CACHE)
#define PAGE_KERNEL_NCG __pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
_PAGE_NO_CACHE | _PAGE_GUARDED)
-#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC)
+#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC | \
+ _PAGE_HWEXEC)
#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
-#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC)
+#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC | \
+ _PAGE_HWEXEC)
/* Protection used for kernel text. We want the debuggers to be able to
* set breakpoints anywhere, so don't write protect the kernel text
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: Fix oops when loading modules
2009-04-07 3:21 [PATCH] powerpc: Fix oops when loading modules Paul Mackerras
@ 2009-04-07 12:19 ` Geert Uytterhoeven
0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2009-04-07 12:19 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
On Tue, 7 Apr 2009, Paul Mackerras wrote:
> 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@pikatech.com>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
Tested-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
(on Sequoia)
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-07 12:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-07 3:21 [PATCH] powerpc: Fix oops when loading modules Paul Mackerras
2009-04-07 12:19 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).