powerpc: Don't write protect kernel text with CONFIG_DYNAMIC_FTRACE enabled
PATCH 1/1 powerpc: Don't write protect kernel text with CONFIG_DYNAMIC_FTRACE enabled
This problem was noticed on an MPC855T platform. Ftrace did oops when trying to write to the kernel text segment.
Many thanks to Joakim for finding the root cause of this problem.
--- arch/powerpc/include/asm/pte-common.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/pte-common.h +1 -1
@@ -162,7 +162,7 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);* on platforms where such control is possible. */ #if defined(CONFIG_KGDB ) || defined(CONFIG_XMON ) || defined(CONFIG_BDI_SWITCH ) ||\ - defined(CONFIG_KPROBES ) + defined(CONFIG_KPROBES ) || defined(CONFIG_DYNAMIC_FTRACE )#define PAGE_KERNEL_TEXT PAGE_KERNEL_X#else #define PAGE_KERNEL_TEXT PAGE_KERNEL_ROX
Signature · 1 line
1.7.4.4
Stefan Roese <[email protected]> wrote:
This problem was noticed on an MPC855T platform. Ftrace did oops when trying to write to the kernel text segment. Many thanks to Joakim for finding the root cause of this problem. Signed-off-by: Stefan Roese <[email protected]> Cc: Joakim Tjernlund <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Steven Rostedt <[email protected]> --- arch/powerpc/include/asm/pte-common.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/include/asm/pte-common.h b/arch/powerpc/include/asm/pte-common.h index 811f04a..8d1569c 100644 --- a/arch/powerpc/include/asm/pte-common.h +++ b/arch/powerpc/include/asm/pte-common.h @@ -162,7 +162,7 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void); * on platforms where such control is possible. */ #if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\ - defined(CONFIG_KPROBES) + defined(CONFIG_KPROBES) || defined(CONFIG_DYNAMIC_FTRACE) #definePAGE_KERNEL_TEXT PAGE_KERNEL_X #else #define PAGE_KERNEL_TEXT PAGE_KERNEL_ROX -- 1.7.4.4
This is fine for a work around but you should take a look at what x86 does for this.
-- Steve
Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.