Lines Matching refs:regs

74 int (*__debugger)(struct pt_regs *regs) __read_mostly;
75 int (*__debugger_ipi)(struct pt_regs *regs) __read_mostly;
76 int (*__debugger_bpt)(struct pt_regs *regs) __read_mostly;
77 int (*__debugger_sstep)(struct pt_regs *regs) __read_mostly;
78 int (*__debugger_iabr_match)(struct pt_regs *regs) __read_mostly;
79 int (*__debugger_break_match)(struct pt_regs *regs) __read_mostly;
80 int (*__debugger_fault_handler)(struct pt_regs *regs) __read_mostly;
181 static unsigned long oops_begin(struct pt_regs *regs) in oops_begin() argument
207 static void oops_end(unsigned long flags, struct pt_regs *regs, in oops_end() argument
225 if (TRAP(regs) == INTERRUPT_SYSTEM_RESET) in oops_end()
228 crash_fadump(regs, "die oops"); in oops_end()
231 crash_kexec(regs); in oops_end()
262 static int __die(const char *str, struct pt_regs *regs, long err) in __die() argument
276 if (notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV) == NOTIFY_STOP) in __die()
280 show_regs(regs); in __die()
286 void die(const char *str, struct pt_regs *regs, long err) in die() argument
293 if (TRAP(regs) != INTERRUPT_SYSTEM_RESET) { in die()
294 if (debugger(regs)) in die()
298 flags = oops_begin(regs); in die()
299 if (__die(str, regs, err)) in die()
301 oops_end(flags, regs, err); in die()
305 void user_single_step_report(struct pt_regs *regs) in user_single_step_report() argument
307 force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)regs->nip); in user_single_step_report()
310 static void show_signal_msg(int signr, struct pt_regs *regs, int code, in show_signal_msg() argument
327 addr, regs->nip, regs->link, code); in show_signal_msg()
329 print_vma_addr(KERN_CONT " in ", regs->nip); in show_signal_msg()
333 show_user_instructions(regs); in show_signal_msg()
336 static bool exception_common(int signr, struct pt_regs *regs, int code, in exception_common() argument
339 if (!user_mode(regs)) { in exception_common()
340 die("Exception in kernel mode", regs, signr); in exception_common()
353 show_signal_msg(signr, regs, code, addr); in exception_common()
360 void _exception_pkey(struct pt_regs *regs, unsigned long addr, int key) in _exception_pkey() argument
362 if (!exception_common(SIGSEGV, regs, SEGV_PKUERR, addr)) in _exception_pkey()
368 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) in _exception() argument
370 if (!exception_common(signr, regs, code, addr)) in _exception()
397 noinstr void hv_nmi_check_nonrecoverable(struct pt_regs *regs) in hv_nmi_check_nonrecoverable() argument
401 unsigned long nip = regs->nip; in hv_nmi_check_nonrecoverable()
403 if (!(regs->msr & MSR_RI)) in hv_nmi_check_nonrecoverable()
405 if (!(regs->msr & MSR_HV)) in hv_nmi_check_nonrecoverable()
407 if (regs->msr & MSR_PR) in hv_nmi_check_nonrecoverable()
437 regs->msr &= ~MSR_RI; in hv_nmi_check_nonrecoverable()
462 hv_nmi_check_nonrecoverable(regs); in DEFINE_INTERRUPT_HANDLER_NMI()
468 if (ppc_md.system_reset_exception(regs)) in DEFINE_INTERRUPT_HANDLER_NMI()
472 if (debugger(regs)) in DEFINE_INTERRUPT_HANDLER_NMI()
481 crash_fadump(regs, "System Reset"); in DEFINE_INTERRUPT_HANDLER_NMI()
483 crash_kexec(regs); in DEFINE_INTERRUPT_HANDLER_NMI()
490 crash_kexec_secondary(regs); in DEFINE_INTERRUPT_HANDLER_NMI()
496 die("System Reset", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER_NMI()
500 nmi_panic(regs, "System Reset"); in DEFINE_INTERRUPT_HANDLER_NMI()
506 die("Unrecoverable nested System Reset", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER_NMI()
509 if (regs_is_unrecoverable(regs)) { in DEFINE_INTERRUPT_HANDLER_NMI()
512 die("Unrecoverable System Reset", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER_NMI()
532 static inline int check_io_access(struct pt_regs *regs) in check_io_access() argument
535 unsigned long msr = regs->msr; in check_io_access()
537 unsigned int *nip = (unsigned int *)regs->nip; in check_io_access()
540 && (entry = search_exception_tables(regs->nip)) != NULL) { in check_io_access()
560 regs->gpr[rb] - _IO_BASE, nip); in check_io_access()
561 regs_set_recoverable(regs); in check_io_access()
562 regs_set_return_ip(regs, extable_fixup(entry)); in check_io_access()
573 #define get_reason(regs) ((regs)->esr) argument
582 #define single_stepping(regs) (current->thread.debug.dbcr0 & DBCR0_IC) argument
583 #define clear_single_step(regs) (current->thread.debug.dbcr0 &= ~DBCR0_IC) argument
584 #define clear_br_trace(regs) do {} while(0) argument
588 #define get_reason(regs) ((regs)->msr) argument
597 #define single_stepping(regs) ((regs)->msr & MSR_SE) argument
598 #define clear_single_step(regs) (regs_set_return_msr((regs), (regs)->msr & ~MSR_SE)) argument
599 #define clear_br_trace(regs) (regs_set_return_msr((regs), (regs)->msr & ~MSR_BE)) argument
605 int machine_check_e500mc(struct pt_regs *regs) in machine_check_e500mc() argument
613 recoverable = fsl_rio_mcheck_exception(regs); in machine_check_e500mc()
712 int machine_check_e500(struct pt_regs *regs) in machine_check_e500() argument
717 if (fsl_rio_mcheck_exception(regs)) in machine_check_e500()
719 if (fsl_pci_mcheck_exception(regs)) in machine_check_e500()
754 int machine_check_generic(struct pt_regs *regs) in machine_check_generic() argument
759 int machine_check_generic(struct pt_regs *regs) in machine_check_generic() argument
761 unsigned long reason = regs->msr; in machine_check_generic()
795 void die_mce(const char *str, struct pt_regs *regs, long err) in die_mce() argument
806 die(str, regs, err); in die_mce()
817 static void __machine_check_exception(struct pt_regs *regs) in __machine_check_exception() argument
832 recover = ppc_md.machine_check_exception(regs); in __machine_check_exception()
834 recover = cur_cpu_spec->machine_check(regs); in __machine_check_exception()
839 if (debugger_fault_handler(regs)) in __machine_check_exception()
842 if (check_io_access(regs)) in __machine_check_exception()
845 die_mce("Machine check", regs, SIGBUS); in __machine_check_exception()
849 if (regs_is_unrecoverable(regs)) in __machine_check_exception()
850 die_mce("Unrecoverable Machine check", regs, SIGBUS); in __machine_check_exception()
857 udbg_printf("SRR0=0x%016lx SRR1=0x%016lx\n", regs->nip, regs->msr); in DEFINE_INTERRUPT_HANDLER_RAW()
858 udbg_printf(" DAR=0x%016lx DSISR=0x%08lx\n", regs->dar, regs->dsisr); in DEFINE_INTERRUPT_HANDLER_RAW()
859 udbg_printf(" LR=0x%016lx R1=0x%08lx\n", regs->link, regs->gpr[1]); in DEFINE_INTERRUPT_HANDLER_RAW()
861 die("Machine check (early boot)", regs, SIGBUS); in DEFINE_INTERRUPT_HANDLER_RAW()
869 __machine_check_exception(regs); in DEFINE_INTERRUPT_HANDLER_ASYNC()
874 __machine_check_exception(regs); in DEFINE_INTERRUPT_HANDLER_NMI()
881 die("System Management Interrupt", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER()
885 static void p9_hmi_special_emu(struct pt_regs *regs) in p9_hmi_special_emu() argument
893 if (__get_user(instr, (unsigned int __user *)regs->nip)) in p9_hmi_special_emu()
906 regs->nip, instr); in p9_hmi_special_emu()
911 msr = regs->msr; /* Grab msr before we flush the bits */ in p9_hmi_special_emu()
931 ea = regs->gpr[rb] + (ra ? regs->gpr[ra] : 0); in p9_hmi_special_emu()
941 regs->nip, instr, (unsigned long)addr); in p9_hmi_special_emu()
956 regs->nip, instr, (unsigned long)addr); in p9_hmi_special_emu()
962 smp_processor_id(), current->comm, current->pid, regs->nip, in p9_hmi_special_emu()
982 regs->nip, instr, msr); in p9_hmi_special_emu()
989 PPC_WARN_EMULATED(lxvw4x, regs); in p9_hmi_special_emu()
992 PPC_WARN_EMULATED(lxvh8x, regs); in p9_hmi_special_emu()
995 PPC_WARN_EMULATED(lxvd2x, regs); in p9_hmi_special_emu()
998 PPC_WARN_EMULATED(lxvb16x, regs); in p9_hmi_special_emu()
1061 regs_add_return_ip(regs, 4); in p9_hmi_special_emu()
1069 old_regs = set_irq_regs(regs); in DEFINE_INTERRUPT_HANDLER_ASYNC()
1081 p9_hmi_special_emu(regs); in DEFINE_INTERRUPT_HANDLER_ASYNC()
1087 ppc_md.handle_hmi_exception(regs); in DEFINE_INTERRUPT_HANDLER_ASYNC()
1095 regs->nip, regs->msr, regs->trap); in DEFINE_INTERRUPT_HANDLER()
1097 _exception(SIGTRAP, regs, TRAP_UNK, 0); in DEFINE_INTERRUPT_HANDLER()
1103 regs->nip, regs->msr, regs->trap); in DEFINE_INTERRUPT_HANDLER_ASYNC()
1105 _exception(SIGTRAP, regs, TRAP_UNK, 0); in DEFINE_INTERRUPT_HANDLER_ASYNC()
1111 regs->nip, regs->msr, regs->trap); in DEFINE_INTERRUPT_HANDLER_NMI()
1113 _exception(SIGTRAP, regs, TRAP_UNK, 0); in DEFINE_INTERRUPT_HANDLER_NMI()
1120 if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5, in DEFINE_INTERRUPT_HANDLER()
1123 if (debugger_iabr_match(regs)) in DEFINE_INTERRUPT_HANDLER()
1125 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1130 _exception(SIGTRAP, regs, TRAP_UNK, 0); in DEFINE_INTERRUPT_HANDLER()
1133 static void __single_step_exception(struct pt_regs *regs) in __single_step_exception() argument
1135 clear_single_step(regs); in __single_step_exception()
1136 clear_br_trace(regs); in __single_step_exception()
1138 if (kprobe_post_handler(regs)) in __single_step_exception()
1141 if (notify_die(DIE_SSTEP, "single_step", regs, 5, in __single_step_exception()
1144 if (debugger_sstep(regs)) in __single_step_exception()
1147 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); in __single_step_exception()
1152 __single_step_exception(regs); in DEFINE_INTERRUPT_HANDLER()
1161 static void emulate_single_step(struct pt_regs *regs) in emulate_single_step() argument
1163 if (single_stepping(regs)) in emulate_single_step()
1164 __single_step_exception(regs); in emulate_single_step()
1194 static void parse_fpe(struct pt_regs *regs) in parse_fpe() argument
1204 _exception(SIGFPE, regs, code, regs->nip); in parse_fpe()
1218 static int emulate_string_inst(struct pt_regs *regs, u32 instword) in emulate_string_inst() argument
1232 EA = (rA == 0) ? 0 : regs->gpr[rA]; in emulate_string_inst()
1238 num_bytes = regs->xer & 0x7f; in emulate_string_inst()
1254 if ((regs->msr & MSR_64BIT) == 0) in emulate_string_inst()
1265 regs->gpr[rT] = 0; in emulate_string_inst()
1266 regs->gpr[rT] |= val << shift; in emulate_string_inst()
1270 val = regs->gpr[rT] >> shift; in emulate_string_inst()
1290 static int emulate_popcntb_inst(struct pt_regs *regs, u32 instword) in emulate_popcntb_inst() argument
1298 tmp = regs->gpr[rs]; in emulate_popcntb_inst()
1302 regs->gpr[ra] = tmp; in emulate_popcntb_inst()
1307 static int emulate_isel(struct pt_regs *regs, u32 instword) in emulate_isel() argument
1316 tmp = (rA == 0) ? 0 : regs->gpr[rA]; in emulate_isel()
1317 bit = (regs->ccr >> (31 - BC)) & 0x1; in emulate_isel()
1319 regs->gpr[rT] = bit ? tmp : regs->gpr[rB]; in emulate_isel()
1325 static inline bool tm_abort_check(struct pt_regs *regs, int cause) in tm_abort_check() argument
1332 if (MSR_TM_TRANSACTIONAL(regs->msr)) { in tm_abort_check()
1340 static inline bool tm_abort_check(struct pt_regs *regs, int reason) in tm_abort_check() argument
1346 static int emulate_instruction(struct pt_regs *regs) in emulate_instruction() argument
1351 if (!user_mode(regs)) in emulate_instruction()
1354 if (get_user(instword, (u32 __user *)(regs->nip))) in emulate_instruction()
1359 PPC_WARN_EMULATED(mfpvr, regs); in emulate_instruction()
1361 regs->gpr[rd] = mfspr(SPRN_PVR); in emulate_instruction()
1367 PPC_WARN_EMULATED(dcba, regs); in emulate_instruction()
1376 PPC_WARN_EMULATED(mcrxr, regs); in emulate_instruction()
1377 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk); in emulate_instruction()
1378 regs->xer &= ~0xf0000000UL; in emulate_instruction()
1384 if (tm_abort_check(regs, in emulate_instruction()
1387 PPC_WARN_EMULATED(string, regs); in emulate_instruction()
1388 return emulate_string_inst(regs, instword); in emulate_instruction()
1393 PPC_WARN_EMULATED(popcntb, regs); in emulate_instruction()
1394 return emulate_popcntb_inst(regs, instword); in emulate_instruction()
1399 PPC_WARN_EMULATED(isel, regs); in emulate_instruction()
1400 return emulate_isel(regs, instword); in emulate_instruction()
1405 PPC_WARN_EMULATED(sync, regs); in emulate_instruction()
1417 PPC_WARN_EMULATED(mfdscr, regs); in emulate_instruction()
1419 regs->gpr[rd] = mfspr(SPRN_DSCR); in emulate_instruction()
1428 PPC_WARN_EMULATED(mtdscr, regs); in emulate_instruction()
1430 current->thread.dscr = regs->gpr[rd]; in emulate_instruction()
1446 static int emulate_math(struct pt_regs *regs) in emulate_math() argument
1450 ret = do_mathemu(regs); in emulate_math()
1452 PPC_WARN_EMULATED(math, regs); in emulate_math()
1456 emulate_single_step(regs); in emulate_math()
1461 _exception(SIGFPE, regs, code, regs->nip); in emulate_math()
1465 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip); in emulate_math()
1472 static inline int emulate_math(struct pt_regs *regs) { return -1; } in emulate_math() argument
1475 static void do_program_check(struct pt_regs *regs) in do_program_check() argument
1477 unsigned int reason = get_reason(regs); in do_program_check()
1484 parse_fpe(regs); in do_program_check()
1491 if (debugger_bpt(regs)) in do_program_check()
1494 if (kprobe_handler(regs)) in do_program_check()
1498 if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP) in do_program_check()
1502 bugaddr = regs->nip; in do_program_check()
1506 if (!is_kernel_addr(bugaddr) && !(regs->msr & MSR_IR)) in do_program_check()
1509 if (!(regs->msr & MSR_PR) && /* not user-mode */ in do_program_check()
1510 report_bug(bugaddr, regs) == BUG_TRAP_TYPE_WARN) { in do_program_check()
1515 regs_set_return_ip(regs, extable_fixup(entry) + regs->nip - bugaddr); in do_program_check()
1519 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip); in do_program_check()
1539 if (user_mode(regs)) { in do_program_check()
1540 _exception(SIGILL, regs, ILL_ILLOPN, regs->nip); in do_program_check()
1545 regs->nip, regs->msr, get_paca()->tm_scratch); in do_program_check()
1546 die("Unrecoverable exception", regs, SIGABRT); in do_program_check()
1558 if (!user_mode(regs)) in do_program_check()
1561 interrupt_cond_local_irq_enable(regs); in do_program_check()
1571 if (!emulate_math(regs)) in do_program_check()
1576 switch (emulate_instruction(regs)) { in do_program_check()
1578 regs_add_return_ip(regs, 4); in do_program_check()
1579 emulate_single_step(regs); in do_program_check()
1582 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip); in do_program_check()
1589 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip); in do_program_check()
1591 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); in do_program_check()
1597 do_program_check(regs); in DEFINE_INTERRUPT_HANDLER()
1606 regs_set_return_msr(regs, regs->msr | REASON_ILLEGAL); in DEFINE_INTERRUPT_HANDLER()
1607 do_program_check(regs); in DEFINE_INTERRUPT_HANDLER()
1615 interrupt_cond_local_irq_enable(regs); in DEFINE_INTERRUPT_HANDLER()
1617 reason = get_reason(regs); in DEFINE_INTERRUPT_HANDLER()
1624 if (tm_abort_check(regs, TM_CAUSE_ALIGNMENT | TM_CAUSE_PERSISTENT)) in DEFINE_INTERRUPT_HANDLER()
1629 fixed = fix_alignment(regs); in DEFINE_INTERRUPT_HANDLER()
1633 regs_add_return_ip(regs, inst_length(reason)); in DEFINE_INTERRUPT_HANDLER()
1634 emulate_single_step(regs); in DEFINE_INTERRUPT_HANDLER()
1647 if (user_mode(regs)) in DEFINE_INTERRUPT_HANDLER()
1648 _exception(sig, regs, code, regs->dar); in DEFINE_INTERRUPT_HANDLER()
1650 bad_page_fault(regs, sig); in DEFINE_INTERRUPT_HANDLER()
1655 die("Kernel stack overflow", regs, SIGSEGV); in DEFINE_INTERRUPT_HANDLER()
1661 "%lx at %lx\n", regs->trap, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1662 die("Unrecoverable FP Unavailable Exception", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER()
1667 if (user_mode(regs)) { in DEFINE_INTERRUPT_HANDLER()
1670 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1675 "%lx at %lx\n", regs->trap, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1676 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER()
1681 if (user_mode(regs)) { in DEFINE_INTERRUPT_HANDLER()
1684 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1689 "%lx at %lx\n", regs->trap, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1690 die("Unrecoverable VSX Unavailable Exception", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER()
1694 static void tm_unavailable(struct pt_regs *regs) in tm_unavailable() argument
1697 if (user_mode(regs)) { in tm_unavailable()
1699 regs_set_return_msr(regs, regs->msr | MSR_TM); in tm_unavailable()
1706 "%lx at %lx\n", regs->trap, regs->nip); in tm_unavailable()
1707 die("Unrecoverable TM Unavailable Exception", regs, SIGABRT); in tm_unavailable()
1731 hv = (TRAP(regs) == INTERRUPT_H_FAC_UNAVAIL); in DEFINE_INTERRUPT_HANDLER()
1744 if (!user_mode(regs)) { in DEFINE_INTERRUPT_HANDLER()
1746 facility, status, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1747 die("Unexpected facility unavailable exception", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER()
1750 interrupt_cond_local_irq_enable(regs); in DEFINE_INTERRUPT_HANDLER()
1769 if (get_user(instword, (u32 __user *)(regs->nip))) { in DEFINE_INTERRUPT_HANDLER()
1778 current->thread.dscr = regs->gpr[rd]; in DEFINE_INTERRUPT_HANDLER()
1787 if (emulate_instruction(regs)) { in DEFINE_INTERRUPT_HANDLER()
1791 regs_add_return_ip(regs, 4); in DEFINE_INTERRUPT_HANDLER()
1792 emulate_single_step(regs); in DEFINE_INTERRUPT_HANDLER()
1814 tm_unavailable(regs); in DEFINE_INTERRUPT_HANDLER()
1819 hv ? "Hypervisor " : "", facility, status, regs->nip, regs->msr); in DEFINE_INTERRUPT_HANDLER()
1822 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); in DEFINE_INTERRUPT_HANDLER()
1833 regs->nip, regs->msr); in DEFINE_INTERRUPT_HANDLER()
1869 regs->nip, regs->msr); in DEFINE_INTERRUPT_HANDLER()
1887 regs->nip, regs->msr); in DEFINE_INTERRUPT_HANDLER()
1907 perf_irq(regs); in DEFINE_INTERRUPT_HANDLER_NMI()
1918 perf_irq(regs); in DEFINE_INTERRUPT_HANDLER_ASYNC()
1929 if (IS_ENABLED(CONFIG_PPC64) && unlikely(arch_irq_disabled_regs(regs))) in DEFINE_INTERRUPT_HANDLER_RAW()
1930 performance_monitor_exception_nmi(regs); in DEFINE_INTERRUPT_HANDLER_RAW()
1932 performance_monitor_exception_async(regs); in DEFINE_INTERRUPT_HANDLER_RAW()
1938 static void handle_debug(struct pt_regs *regs, unsigned long debug_status) in handle_debug() argument
1950 do_send_trap(regs, mfspr(SPRN_DAC1), debug_status, in handle_debug()
1955 do_send_trap(regs, mfspr(SPRN_DAC2), debug_status, in handle_debug()
1961 do_send_trap(regs, mfspr(SPRN_IAC1), debug_status, in handle_debug()
1966 do_send_trap(regs, mfspr(SPRN_IAC2), debug_status, in handle_debug()
1972 do_send_trap(regs, mfspr(SPRN_IAC3), debug_status, in handle_debug()
1977 do_send_trap(regs, mfspr(SPRN_IAC4), debug_status, in handle_debug()
1988 regs_set_return_msr(regs, regs->msr | MSR_DE); in handle_debug()
1999 unsigned long debug_status = regs->dsisr; in DEFINE_INTERRUPT_HANDLER()
2009 regs_set_return_msr(regs, regs->msr & ~MSR_DE); in DEFINE_INTERRUPT_HANDLER()
2017 if (user_mode(regs)) { in DEFINE_INTERRUPT_HANDLER()
2020 regs_set_return_msr(regs, regs->msr | MSR_DE); in DEFINE_INTERRUPT_HANDLER()
2024 if (kprobe_post_handler(regs)) in DEFINE_INTERRUPT_HANDLER()
2027 if (notify_die(DIE_SSTEP, "block_step", regs, 5, in DEFINE_INTERRUPT_HANDLER()
2031 if (debugger_sstep(regs)) in DEFINE_INTERRUPT_HANDLER()
2034 regs_set_return_msr(regs, regs->msr & ~MSR_DE); in DEFINE_INTERRUPT_HANDLER()
2041 if (kprobe_post_handler(regs)) in DEFINE_INTERRUPT_HANDLER()
2044 if (notify_die(DIE_SSTEP, "single_step", regs, 5, in DEFINE_INTERRUPT_HANDLER()
2049 if (debugger_sstep(regs)) in DEFINE_INTERRUPT_HANDLER()
2052 if (user_mode(regs)) { in DEFINE_INTERRUPT_HANDLER()
2056 regs_set_return_msr(regs, regs->msr | MSR_DE); in DEFINE_INTERRUPT_HANDLER()
2062 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2064 handle_debug(regs, debug_status); in DEFINE_INTERRUPT_HANDLER()
2073 if (!user_mode(regs)) { in DEFINE_INTERRUPT_HANDLER()
2075 " at %lx\n", regs->nip); in DEFINE_INTERRUPT_HANDLER()
2076 die("Kernel VMX/Altivec assist exception", regs, SIGILL); in DEFINE_INTERRUPT_HANDLER()
2081 PPC_WARN_EMULATED(altivec, regs); in DEFINE_INTERRUPT_HANDLER()
2082 err = emulate_altivec(regs); in DEFINE_INTERRUPT_HANDLER()
2084 regs_add_return_ip(regs, 4); /* skip emulated instruction */ in DEFINE_INTERRUPT_HANDLER()
2085 emulate_single_step(regs); in DEFINE_INTERRUPT_HANDLER()
2091 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2096 "in %s at %lx\n", current->comm, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2105 unsigned long error_code = regs->dsisr; in DEFINE_INTERRUPT_HANDLER()
2112 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2125 interrupt_cond_local_irq_enable(regs); in DEFINE_INTERRUPT_HANDLER()
2146 err = do_spe_mathemu(regs); in DEFINE_INTERRUPT_HANDLER()
2148 regs_add_return_ip(regs, 4); /* skip emulated instruction */ in DEFINE_INTERRUPT_HANDLER()
2149 emulate_single_step(regs); in DEFINE_INTERRUPT_HANDLER()
2155 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2159 "in %s at %lx\n", current->comm, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2161 _exception(SIGFPE, regs, code, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2171 interrupt_cond_local_irq_enable(regs); in DEFINE_INTERRUPT_HANDLER()
2174 if (regs->msr & MSR_SPE) in DEFINE_INTERRUPT_HANDLER()
2178 regs_add_return_ip(regs, -4); in DEFINE_INTERRUPT_HANDLER()
2179 err = speround_handler(regs); in DEFINE_INTERRUPT_HANDLER()
2181 regs_add_return_ip(regs, 4); /* skip emulated instruction */ in DEFINE_INTERRUPT_HANDLER()
2182 emulate_single_step(regs); in DEFINE_INTERRUPT_HANDLER()
2188 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2192 "in %s at %lx\n", current->comm, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2194 _exception(SIGFPE, regs, FPE_FLTUNK, regs->nip); in DEFINE_INTERRUPT_HANDLER()
2206 void __noreturn unrecoverable_exception(struct pt_regs *regs) in unrecoverable_exception() argument
2209 regs->trap, regs->nip, regs->msr); in unrecoverable_exception()
2210 die("Unrecoverable exception", regs, SIGABRT); in unrecoverable_exception()
2221 void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs) in WatchdogHandler() argument
2231 WatchdogHandler(regs); in DEFINE_INTERRUPT_HANDLER_NMI()
2243 regs->gpr[1], regs->nip); in DEFINE_INTERRUPT_HANDLER()
2244 die("Bad kernel stack pointer", regs, SIGABRT); in DEFINE_INTERRUPT_HANDLER()