]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/64s: move bad_page_fault handling to C
authorNicholas Piggin <npiggin@gmail.com>
Sat, 30 Jan 2021 13:08:24 +0000 (23:08 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 8 Feb 2021 13:02:10 +0000 (00:02 +1100)
This simplifies code, and it is also useful when introducing
interrupt handler wrappers when introducing wrapper functionality
that doesn't cope with asm entry code calling into more than one
handler function.

32-bit and 64e still have some such cases, which limits some ways
they can use interrupt wrappers.

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-15-npiggin@gmail.com
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/mm/fault.c

index fc793fa3fdf8784e1f68eb73bc7a1b5f3131f98f..6e245e06848e3d59884f554401e4c4d1028ce54a 100644 (file)
@@ -1447,12 +1447,6 @@ BEGIN_MMU_FTR_SECTION
 MMU_FTR_SECTION_ELSE
        bl      do_page_fault
 ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
-       cmpdi   r3,0
-       beq+    interrupt_return
-       mr      r5,r3
-       addi    r3,r1,STACK_FRAME_OVERHEAD
-       ld      r4,_DAR(r1)
-       bl      __bad_page_fault
        b       interrupt_return
 
 1:     bl      do_break
@@ -1557,12 +1551,6 @@ BEGIN_MMU_FTR_SECTION
 MMU_FTR_SECTION_ELSE
        bl      do_page_fault
 ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
-       cmpdi   r3,0
-       beq+    interrupt_return
-       mr      r5,r3
-       addi    r3,r1,STACK_FRAME_OVERHEAD
-       ld      r4,_DAR(r1)
-       bl      __bad_page_fault
        b       interrupt_return
 
        GEN_KVM instruction_access
index 970ac317e018f32ba62f108c9c5e29df6df0b79b..fc2d9a27c649b314e40053f7ac0d67b6c7966cf4 100644 (file)
@@ -557,6 +557,10 @@ long do_page_fault(struct pt_regs *regs)
        if (likely(entry)) {
                instruction_pointer_set(regs, extable_fixup(entry));
                err = 0;
+       } else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) {
+               /* 32 and 64e handle this in asm */
+               __bad_page_fault(regs, err);
+               err = 0;
        }
 
 out: