diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2021-01-30 23:08:22 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-02-09 00:02:09 +1100 |
commit | 71f47976fafc4375674bd0714153be10f878040a (patch) | |
tree | 3df62506464a2dc4c279766b69aaffa793e495e2 /arch | |
parent | 8458c628a53ba4311b2df12370be1a6f1870ff37 (diff) | |
download | linux-71f47976fafc4375674bd0714153be10f878040a.tar.gz linux-71f47976fafc4375674bd0714153be10f878040a.tar.bz2 linux-71f47976fafc4375674bd0714153be10f878040a.zip |
powerpc/64s: add do_bad_page_fault_segv handler
This function acts like an interrupt handler so it needs to follow
the standard interrupt handler function signature which will be
introduced in a future change.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-13-npiggin@gmail.com
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/bug.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/fault.c | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index 4220789b9a97..8f09ddae9305 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h @@ -114,6 +114,7 @@ struct pt_regs; long do_page_fault(struct pt_regs *); void bad_page_fault(struct pt_regs *, int); void __bad_page_fault(struct pt_regs *regs, int sig); +void do_bad_page_fault_segv(struct pt_regs *regs); extern void _exception(int, struct pt_regs *, int, unsigned long); extern void _exception_pkey(struct pt_regs *, unsigned long, int); extern void die(const char *, struct pt_regs *, long); diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 33f88a1dcd08..fc793fa3fdf8 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -2151,9 +2151,7 @@ EXC_COMMON_BEGIN(h_data_storage_common) GEN_COMMON h_data_storage addi r3,r1,STACK_FRAME_OVERHEAD BEGIN_MMU_FTR_SECTION - ld r4,_DAR(r1) - li r5,SIGSEGV - bl bad_page_fault + bl do_bad_page_fault_segv MMU_FTR_SECTION_ELSE bl unknown_exception ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_TYPE_RADIX) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 5dd3248b47c7..e476d7701413 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -615,3 +615,10 @@ void bad_page_fault(struct pt_regs *regs, int sig) else __bad_page_fault(regs, sig); } + +#ifdef CONFIG_PPC_BOOK3S_64 +void do_bad_page_fault_segv(struct pt_regs *regs) +{ + bad_page_fault(regs, SIGSEGV); +} +#endif |