]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc: add and use unknown_async_exception
authorNicholas Piggin <npiggin@gmail.com>
Sat, 30 Jan 2021 13:08:31 +0000 (23:08 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 8 Feb 2021 13:02:11 +0000 (00:02 +1100)
This is currently the same as unknown_exception, but it will diverge
after interrupt wrappers are added and code moved out of asm into the
wrappers (e.g., async handlers will check FINISH_NAP).

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-22-npiggin@gmail.com
arch/powerpc/include/asm/hw_irq.h
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/head_book3s_32.S
arch/powerpc/kernel/traps.c

index e5def36212cfc43c17cff60a818d1a8284a45eba..75c2b137fc007cd9d24174fbb570ff79754cf3be 100644 (file)
@@ -57,6 +57,7 @@ extern void timer_interrupt(struct pt_regs *);
 extern void performance_monitor_exception(struct pt_regs *regs);
 extern void WatchdogException(struct pt_regs *regs);
 extern void unknown_exception(struct pt_regs *regs);
+void unknown_async_exception(struct pt_regs *regs);
 
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
index 6e245e06848e3d59884f554401e4c4d1028ce54a..86eb1c9400b1dea82202ce1ac2bfbaa088d228ec 100644 (file)
@@ -1926,7 +1926,7 @@ EXC_COMMON_BEGIN(doorbell_super_common)
 #ifdef CONFIG_PPC_DOORBELL
        bl      doorbell_exception
 #else
-       bl      unknown_exception
+       bl      unknown_async_exception
 #endif
        b       interrupt_return
 
@@ -2312,7 +2312,7 @@ EXC_COMMON_BEGIN(h_doorbell_common)
 #ifdef CONFIG_PPC_DOORBELL
        bl      doorbell_exception
 #else
-       bl      unknown_exception
+       bl      unknown_async_exception
 #endif
        b       interrupt_return
 
index 61f862fa9655c86a247cdcd155dece1c2fab0737..1b9c62423b094325a8f26fc6f61612eb8b0001c9 100644 (file)
@@ -238,8 +238,8 @@ __secondary_hold_acknowledge:
 
 /* System reset */
 /* core99 pmac starts the seconary here by changing the vector, and
-   putting it back to what it was (unknown_exception) when done.  */
-       EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
+   putting it back to what it was (unknown_async_exception) when done.  */
+       EXCEPTION(0x100, Reset, unknown_async_exception, EXC_XFER_STD)
 
 /* Machine check */
 /*
@@ -641,7 +641,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)
 #endif
 
 #ifndef CONFIG_TAU_INT
-#define TAUException   unknown_exception
+#define TAUException   unknown_async_exception
 #endif
 
        EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_STD)
index 6da3a3642dfba99a8e0d340ded75bf48ffb54e52..6691774fe1fbf299e223813f402f52abbe66f0c2 100644 (file)
@@ -1073,6 +1073,18 @@ void unknown_exception(struct pt_regs *regs)
        exception_exit(prev_state);
 }
 
+void unknown_async_exception(struct pt_regs *regs)
+{
+       enum ctx_state prev_state = exception_enter();
+
+       printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
+              regs->nip, regs->msr, regs->trap);
+
+       _exception(SIGTRAP, regs, TRAP_UNK, 0);
+
+       exception_exit(prev_state);
+}
+
 void instruction_breakpoint_exception(struct pt_regs *regs)
 {
        enum ctx_state prev_state = exception_enter();