cregit-Linux how code gets into the kernel

Release 4.14 arch/powerpc/kernel/traps.c

/*
 *  Copyright (C) 1995-1996  Gary Thomas (gdt@linuxppc.org)
 *  Copyright 2007-2010 Freescale Semiconductor, Inc.
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version
 *  2 of the License, or (at your option) any later version.
 *
 *  Modified by Cort Dougan (cort@cs.nmt.edu)
 *  and Paul Mackerras (paulus@samba.org)
 */

/*
 * This file handles the architecture-dependent parts of hardware exceptions
 */

#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/extable.h>
#include <linux/module.h>	/* print_modules */
#include <linux/prctl.h>
#include <linux/delay.h>
#include <linux/kprobes.h>
#include <linux/kexec.h>
#include <linux/backlight.h>
#include <linux/bug.h>
#include <linux/kdebug.h>
#include <linux/ratelimit.h>
#include <linux/context_tracking.h>

#include <asm/emulated_ops.h>
#include <asm/pgtable.h>
#include <linux/uaccess.h>
#include <asm/debugfs.h>
#include <asm/io.h>
#include <asm/machdep.h>
#include <asm/rtas.h>
#include <asm/pmc.h>
#include <asm/reg.h>
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
#endif
#ifdef CONFIG_PPC64
#include <asm/firmware.h>
#include <asm/processor.h>
#include <asm/tm.h>
#endif
#include <asm/kexec.h>
#include <asm/ppc-opcode.h>
#include <asm/rio.h>
#include <asm/fadump.h>
#include <asm/switch_to.h>
#include <asm/tm.h>
#include <asm/debug.h>
#include <asm/asm-prototypes.h>
#include <asm/hmi.h>
#include <sysdev/fsl_pci.h>
#include <asm/kprobes.h>

#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC_CORE)
int (*__debugger)(struct pt_regs *regs) __read_mostly;
int (*__debugger_ipi)(struct pt_regs *regs) __read_mostly;
int (*__debugger_bpt)(struct pt_regs *regs) __read_mostly;
int (*__debugger_sstep)(struct pt_regs *regs) __read_mostly;
int (*__debugger_iabr_match)(struct pt_regs *regs) __read_mostly;
int (*__debugger_break_match)(struct pt_regs *regs) __read_mostly;
int (*__debugger_fault_handler)(struct pt_regs *regs) __read_mostly;


EXPORT_SYMBOL(__debugger);

EXPORT_SYMBOL(__debugger_ipi);

EXPORT_SYMBOL(__debugger_bpt);

EXPORT_SYMBOL(__debugger_sstep);

EXPORT_SYMBOL(__debugger_iabr_match);

EXPORT_SYMBOL(__debugger_break_match);

EXPORT_SYMBOL(__debugger_fault_handler);
#endif

/* Transactional Memory trap debug */
#ifdef TM_DEBUG_SW

#define TM_DEBUG(x...) printk(KERN_INFO x)
#else

#define TM_DEBUG(x...) do { } while(0)
#endif

/*
 * Trap & Exception support
 */

#ifdef CONFIG_PMAC_BACKLIGHT

static void pmac_backlight_unblank(void) { mutex_lock(&pmac_backlight_mutex); if (pmac_backlight) { struct backlight_properties *props; props = &pmac_backlight->props; props->brightness = props->max_brightness; props->power = FB_BLANK_UNBLANK; backlight_update_status(pmac_backlight); } mutex_unlock(&pmac_backlight_mutex); }

Contributors

PersonTokensPropCommitsCommitProp
Anton Blanchard57100.00%1100.00%
Total57100.00%1100.00%

#else
static inline void pmac_backlight_unblank(void) { }

Contributors

PersonTokensPropCommitsCommitProp
Anton Blanchard8100.00%1100.00%
Total8100.00%1100.00%

#endif /* * If oops/die is expected to crash the machine, return true here. * * This should not be expected to be 100% accurate, there may be * notifiers registered or other unexpected conditions that may bring * down the kernel. Or if the current process in the kernel is holding * locks or has other critical state, the kernel may become effectively * unusable anyway. */
bool die_will_crash(void) { if (should_fadump_crash()) return true; if (kexec_should_crash(current)) return true; if (in_interrupt() || panic_on_oops || !current->pid || is_global_init(current)) return true; return false; }

Contributors

PersonTokensPropCommitsCommitProp
Nicholas Piggin48100.00%1100.00%
Total48100.00%1100.00%

static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; static int die_owner = -1; static unsigned int die_nest_count; static int die_counter;
static unsigned long oops_begin(struct pt_regs *regs) { int cpu; unsigned long flags; oops_enter(); /* racy, but better than risking deadlock. */ raw_local_irq_save(flags); cpu = smp_processor_id(); if (!arch_spin_trylock(&die_lock)) { if (cpu == die_owner) /* nested oops. should stop eventually */; else arch_spin_lock(&die_lock); } die_nest_count++; die_owner = cpu; console_verbose(); bust_spinlocks(1); if (machine_is(powermac)) pmac_backlight_unblank(); return flags; }

Contributors

PersonTokensPropCommitsCommitProp
Anton Blanchard7080.46%457.14%
Paul Mackerras1213.79%114.29%
Benjamin Herrenschmidt44.60%114.29%
Michael Hanselmann11.15%114.29%
Total87100.00%7100.00%

NOKPROBE_SYMBOL(oops_begin);
static void oops_end(unsigned long flags, struct pt_regs *regs, int signr) { bust_spinlocks(0); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); die_nest_count--; oops_exit(); printk("\n"); if (!die_nest_count) { /* Nest count reaches zero, release the lock. */ die_owner = -1; arch_spin_unlock(&die_lock); } raw_local_irq_restore(flags); crash_fadump(regs, "die oops"); if (kexec_should_crash(current)) crash_kexec(regs); if (!signr) return; /* * While our oops output is serialised by a spinlock, output * from panic() called below can race and corrupt it. If we * know we are going to panic, delay for 1 second so we have a * chance to get clean backtraces from all CPUs that are oopsing. */ if (in_interrupt() || panic_on_oops || !current->pid || is_global_init(current)) { mdelay(MSEC_PER_SEC); } if (in_interrupt()) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); do_exit(signr); }

Contributors

PersonTokensPropCommitsCommitProp
Anton Blanchard12388.49%240.00%
Mahesh Salgaonkar75.04%120.00%
Nicholas Piggin75.04%120.00%
Rusty Russell21.44%120.00%
Total139100.00%5100.00%

NOKPROBE_SYMBOL(oops_end);
static int __die(const char *str, struct pt_regs *regs, long err) { printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN)) printk("LE "); else printk("BE "); if (IS_ENABLED(CONFIG_PREEMPT)) pr_cont("PREEMPT "); if (IS_ENABLED(CONFIG_SMP)) pr_cont("SMP NR_CPUS=%d ", NR_CPUS); if (debug_pagealloc_enabled()) pr_cont("DEBUG_PAGEALLOC "); if (IS_ENABLED(CONFIG_NUMA)) pr_cont("NUMA "); pr_cont("%s\n", ppc_md.name ? ppc_md.name : ""); if (notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV) == NOTIFY_STOP) return 1; print_modules(); show_regs(regs); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Anton Blanchard4531.03%333.33%
Paul Mackerras4531.03%111.11%
Michael Ellerman4128.28%333.33%
Benjamin Herrenschmidt96.21%111.11%
JoonSoo Kim53.45%111.11%
Total145100.00%9100.00%

NOKPROBE_SYMBOL(__die);
void die(const char *str, struct pt_regs *regs, long err) { unsigned long flags; if (debugger(regs)) return; flags = oops_begin(regs); if (__die(str, regs, err)) err = 0; oops_end(flags, regs, err); }

Contributors

PersonTokensPropCommitsCommitProp
Anton Blanchard3557.38%350.00%
Paul Mackerras1321.31%116.67%
Nicholas Piggin1219.67%116.67%
David J. Wilder11.64%116.67%
Total61100.00%6100.00%

NOKPROBE_SYMBOL(die);
void user_single_step_siginfo(struct task_struct *tsk, struct pt_regs *regs, siginfo_t *info) { memset(info, 0, sizeof(*info)); info->si_signo = SIGTRAP; info->si_code = TRAP_TRACE; info->si_addr = (void __user *)regs->nip; }

Contributors

PersonTokensPropCommitsCommitProp
Oleg Nesterov57100.00%1100.00%
Total57100.00%1100.00%


void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) { siginfo_t info; const char fmt32[] = KERN_INFO "%s[%d]: unhandled signal %d " \ "at %08lx nip %08lx lr %08lx code %x\n"; const char fmt64[] = KERN_INFO "%s[%d]: unhandled signal %d " \ "at %016lx nip %016lx lr %016lx code %x\n"; if (!user_mode(regs)) { die("Exception in kernel mode", regs, signr); return; } if (show_unhandled_signals && unhandled_signal(current, signr)) { printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32, current->comm, current->pid, signr, addr, regs->nip, regs->link, code); } if (arch_irqs_disabled() && !arch_irq_disabled_regs(regs)) local_irq_enable(); current->thread.trap_nr = code; memset(&info, 0, sizeof(info)); info.si_signo = signr; info.si_code = code; info.si_addr = (void __user *) addr; force_sig_info(signr, &info, current); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras8849.16%112.50%
Olof Johansson6636.87%112.50%
Benjamin Herrenschmidt147.82%225.00%
Ananth N. Mavinakayanahalli84.47%112.50%
Michael Ellerman10.56%112.50%
Christian Dietrich10.56%112.50%
Anton Blanchard10.56%112.50%
Total179100.00%8100.00%


void system_reset_exception(struct pt_regs *regs) { /* * Avoid crashes in case of nested NMI exceptions. Recoverability * is determined by RI and in_nmi */ bool nested = in_nmi(); if (!nested) nmi_enter(); __this_cpu_inc(irq_stat.sreset_irqs); /* See if any machine dependent calls */ if (ppc_md.system_reset_exception) { if (ppc_md.system_reset_exception(regs)) goto out; } if (debugger(regs)) goto out; /* * A system reset is a request to dump, so we always send * it through the crashdump code (if fadump or kdump are * registered). */ crash_fadump(regs, "System Reset"); crash_kexec(regs); /* * We aren't the primary crash CPU. We need to send it * to a holding pattern to avoid it ending up in the panic * code. */ crash_kexec_secondary(regs); /* * No debugger or crash dump registered, print logs then * panic. */ __die("System Reset", regs, SIGABRT); mdelay(2*MSEC_PER_SEC); /* Wait a little while for others to print */ add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); nmi_panic(regs, "System Reset"); out: #ifdef CONFIG_PPC_BOOK3S_64 BUG_ON(get_paca()->in_nmi == 0); if (get_paca()->in_nmi > 1) nmi_panic(regs, "Unrecoverable nested System Reset"); #endif /* Must die if the interrupt is not recoverable */ if (!(regs->msr & MSR_RI)) nmi_panic(regs, "Unrecoverable System Reset"); if (!nested) nmi_exit(); /* What should we do here? We could issue a shutdown or hard reset. */ }

Contributors

PersonTokensPropCommitsCommitProp
Nicholas Piggin12269.71%457.14%
Paul Mackerras4827.43%228.57%
Arnd Bergmann52.86%114.29%
Total175100.00%7100.00%

/* * I/O accesses can cause machine checks on powermacs. * Check if the NIP corresponds to the address of a sync * instruction for which there is an entry in the exception * table. * Note that the 601 only takes a machine check on TEA * (transfer error ack) signal assertion, and does not * set any of the top 16 bits of SRR1. * -- paulus. */
static inline int check_io_access(struct pt_regs *regs) { #ifdef CONFIG_PPC32 unsigned long msr = regs->msr; const struct exception_table_entry *entry; unsigned int *nip = (unsigned int *)regs->nip; if (((msr & 0xffff0000) == 0 || (msr & (0x80000 | 0x40000))) && (entry = search_exception_tables(regs->nip)) != NULL) { /* * Check that it's a sync instruction, or somewhere * in the twi; isync; nop sequence that inb/inw/inl uses. * As the address is in the exception table * we should be able to read the instr there. * For the debug message, we look at the preceding * load or store. */ if (*nip == PPC_INST_NOP) nip -= 2; else if (*nip == PPC_INST_ISYNC) --nip; if (*nip == PPC_INST_SYNC || (*nip >> 26) == OP_TRAP) { unsigned int rb; --nip; rb = (*nip >> 11) & 0x1f; printk(KERN_DEBUG "%s bad port %lx at %p\n", (*nip & 0x100)? "OUT to": "IN from", regs->gpr[rb] - _IO_BASE, nip); regs->msr |= MSR_RI; regs->nip = extable_fixup(entry); return 1; } } #endif /* CONFIG_PPC32 */ return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras18094.24%120.00%
Christophe Leroy42.09%120.00%
Nicholas Piggin31.57%120.00%
Benjamin Herrenschmidt31.57%120.00%
Kumar Gala10.52%120.00%
Total191100.00%5100.00%

#ifdef CONFIG_PPC_ADV_DEBUG_REGS /* On 4xx, the reason for the machine check or program exception is in the ESR. */ #define get_reason(regs) ((regs)->dsisr) #define REASON_FP ESR_FP #define REASON_ILLEGAL (ESR_PIL | ESR_PUO) #define REASON_PRIVILEGED ESR_PPR #define REASON_TRAP ESR_PTR /* single-step stuff */ #define single_stepping(regs) (current->thread.debug.dbcr0 & DBCR0_IC) #define clear_single_step(regs) (current->thread.debug.dbcr0 &= ~DBCR0_IC) #else /* On non-4xx, the reason for the machine check or program exception is in the MSR. */ #define get_reason(regs) ((regs)->msr) #define REASON_TM SRR1_PROGTM #define REASON_FP SRR1_PROGFPE #define REASON_ILLEGAL SRR1_PROGILL #define REASON_PRIVILEGED SRR1_PROGPRIV #define REASON_TRAP SRR1_PROGTRAP #define single_stepping(regs) ((regs)->msr & MSR_SE) #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) #endif #if defined(CONFIG_E500)
int machine_check_e500mc(struct pt_regs *regs) { unsigned long mcsr = mfspr(SPRN_MCSR); unsigned long pvr = mfspr(SPRN_PVR); unsigned long reason = mcsr; int recoverable = 1; if (reason & MCSR_LD) { recoverable = fsl_rio_mcheck_exception(regs); if (recoverable == 1) goto silent_out; } printk("Machine check in kernel mode.\n"); printk("Caused by (from MCSR=%lx): ", reason); if (reason & MCSR_MCP) printk("Machine Check Signal\n"); if (reason & MCSR_ICPERR) { printk("Instruction Cache Parity Error\n"); /* * This is recoverable by invalidating the i-cache. */ mtspr(SPRN_L1CSR1, mfspr(SPRN_L1CSR1) | L1CSR1_ICFI); while (mfspr(SPRN_L1CSR1) & L1CSR1_ICFI) ; /* * This will generally be accompanied by an instruction * fetch error report -- only treat MCSR_IF as fatal * if it wasn't due to an L1 parity error. */ reason &= ~MCSR_IF; } if (reason & MCSR_DCPERR_MC) { printk("Data Cache Parity Error\n"); /* * In write shadow mode we auto-recover from the error, but it * may still get logged and cause a machine check. We should * only treat the non-write shadow case as non-recoverable. */ /* On e6500 core, L1 DCWS (Data cache write shadow mode) bit * is not implemented but L1 data cache always runs in write * shadow mode. Hence on data cache parity errors HW will * automatically invalidate the L1 Data Cache. */ if (PVR_VER(pvr) != PVR_VER_E6500) { if (!(mfspr(SPRN_L1CSR2) & L1CSR2_DCWS)) recoverable = 0; } } if (reason & MCSR_L2MMU_MHIT) { printk("Hit on multiple TLB entries\n"); recoverable = 0; } if (reason & MCSR_NMI) printk("Non-maskable interrupt\n"); if (reason & MCSR_IF) { printk("Instruction Fetch Error Report\n"); recoverable = 0; } if (reason & MCSR_LD) { printk("Load Error Report\n"); recoverable = 0; } if (reason & MCSR_ST) { printk("Store Error Report\n"); recoverable = 0; } if (reason & MCSR_LDG) { printk("Guarded Load Error Report\n"); recoverable = 0; } if (reason & MCSR_TLBSYNC) printk("Simultaneous tlbsync operations\n"); if (reason & MCSR_BSL2_ERR) { printk("Level 2 Cache Error\n"); recoverable = 0; } if (reason & MCSR_MAV) { u64 addr; addr = mfspr(SPRN_MCAR); addr |= (u64)mfspr(SPRN_MCARU) << 32; printk("Machine Check %s Address: %#llx\n", reason & MCSR_MEA ? "Effective" : "Physical", addr); } silent_out: mtspr(SPRN_MCSR, mcsr); return mfspr(SPRN_MCSR) == 0 && recoverable; }

Contributors

PersonTokensPropCommitsCommitProp
Scott Wood29983.52%240.00%
Shaohui Xie256.98%120.00%
Matt Weber215.87%120.00%
Kumar Gala133.63%120.00%
Total358100.00%5100.00%


int machine_check_e500(struct pt_regs *regs) { unsigned long reason = mfspr(SPRN_MCSR); if (reason & MCSR_BUS_RBERR) { if (fsl_rio_mcheck_exception(regs)) return 1; if (fsl_pci_mcheck_exception(regs)) return 1; } printk("Machine check in kernel mode.\n"); printk("Caused by (from MCSR=%lx): ", reason); if (reason & MCSR_MCP) printk("Machine Check Signal\n"); if (reason & MCSR_ICPERR) printk("Instruction Cache Parity Error\n"); if (reason & MCSR_DCP_PERR) printk("Data Cache Push Parity Error\n"); if (reason & MCSR_DCPERR) printk("Data Cache Parity Error\n"); if (reason & MCSR_BUS_IAERR) printk("Bus - Instruction Address Error\n"); if (reason & MCSR_BUS_RAERR) printk("Bus - Read Address Error\n"); if (reason & MCSR_BUS_WAERR) printk("Bus - Write Address Error\n"); if (reason & MCSR_BUS_IBERR) printk("Bus - Instruction Data Error\n"); if (reason & MCSR_BUS_RBERR) printk("Bus - Read Data Bus Error\n"); if (reason & MCSR_BUS_WBERR) printk("Bus - Write Data Bus Error\n"); if (reason & MCSR_BUS_IPERR) printk("Bus - Instruction Parity Error\n"); if (reason & MCSR_BUS_RPERR) printk("Bus - Read Parity Error\n"); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras14373.71%116.67%
Benjamin Herrenschmidt2010.31%116.67%
Shaohui Xie189.28%116.67%
Jia Hongtao105.15%116.67%
Michael Ellerman21.03%116.67%
Wladislav Wiebe10.52%116.67%
Total194100.00%6100.00%


int machine_check_generic(struct pt_regs *regs) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Kumar Gala13100.00%1100.00%
Total13100.00%1100.00%

#elif defined(CONFIG_E200)
int machine_check_e200(struct pt_regs *regs) { unsigned long reason = mfspr(SPRN_MCSR); printk("Machine check in kernel mode.\n"); printk("Caused by (from MCSR=%lx): ", reason); if (reason & MCSR_MCP) printk("Machine Check Signal\n"); if (reason & MCSR_CP_PERR) printk("Cache Push Parity Error\n"); if (reason & MCSR_CPERR) printk("Cache Parity Error\n"); if (reason & MCSR_EXCP_ERR) printk("ISI, ITLB, or Bus Error on first instruction fetch for an exception handler\n"); if (reason & MCSR_BUS_IRERR) printk("Bus - Read Bus Error on instruction fetch\n"); if (reason & MCSR_BUS_DRERR) printk("Bus - Read Bus Error on data load\n"); if (reason & MCSR_BUS_WRERR) printk("Bus - Write Bus Error on buffered store or cache line push\n"); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras8980.18%133.33%
Benjamin Herrenschmidt2018.02%133.33%
Michael Ellerman21.80%133.33%
Total111100.00%3100.00%

#elif defined(CONFIG_PPC32)
int machine_check_generic(struct pt_regs *regs) { unsigned long reason = regs->msr; printk("Machine check in kernel mode.\n"); printk("Caused by (from SRR1=%lx): ", reason); switch (reason & 0x601F0000) { case 0x80000: printk("Machine check signal\n"); break; case 0: /* for 601 */ case 0x40000: case 0x140000: /* 7450 MSS error and TEA */ printk("Transfer error ack signal\n"); break; case 0x20000: printk("Data parity error signal\n"); break; case 0x10000: printk("Address parity error signal\n"); break; case 0x20000000: printk("L1 Data Cache error\n"); break; case 0x40000000: printk("L1 Instruction Cache error\n"); break; case 0x00100000: printk("L2 data cache parity error\n"); break; default: printk("Unknown values in msr\n"); } return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras9782.20%125.00%
Benjamin Herrenschmidt1512.71%125.00%
Olof Johansson43.39%125.00%
Michael Ellerman21.69%125.00%
Total118100.00%4100.00%

#endif /* everything else */
void machine_check_exception(struct pt_regs *regs) { int recover = 0; bool nested = in_nmi(); if (!nested) nmi_enter(); /* 64s accounts the mce in machine_check_early when in HVMODE */ if (!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !cpu_has_feature(CPU_FTR_HVMODE)) __this_cpu_inc(irq_stat.mce_exceptions); add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE); /* See if any machine dependent calls. In theory, we would want * to call the CPU first, and call the ppc_md. one if the CPU * one returns a positive number. However there is existing code * that assumes the board gets a first chance, so let's keep it * that way for now and fix things later. --BenH. */ if (ppc_md.machine_check_exception) recover = ppc_md.machine_check_exception(regs); else if (cur_cpu_spec->machine_check) recover = cur_cpu_spec->machine_check(regs); if (recover > 0) goto bail; if (debugger_fault_handler(regs)) goto bail; if (check_io_access(regs)) goto bail; die("Machine check", regs, SIGBUS); /* Must die if the interrupt is not recoverable */ if (!(regs->msr & MSR_RI)) nmi_panic(regs, "Unrecoverable Machine check"); bail: if (!nested) nmi_exit(); }

Contributors

PersonTokensPropCommitsCommitProp
Olof Johansson5333.76%111.11%
Nicholas Piggin3924.84%222.22%
Paul Mackerras2616.56%111.11%
Benjamin Herrenschmidt138.28%111.11%
Li Zhong127.64%111.11%
Mahesh Salgaonkar74.46%111.11%
Anton Blanchard53.18%111.11%
Christoph Lameter21.27%111.11%
Total157100.00%9100.00%


void SMIException(struct pt_regs *regs) { die("System Management Interrupt", regs, SIGABRT); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras19100.00%1100.00%
Total19100.00%1100.00%


void handle_hmi_exception(struct pt_regs *regs) { struct pt_regs *old_regs; old_regs = set_irq_regs(regs); irq_enter(); if (ppc_md.handle_hmi_exception) ppc_md.handle_hmi_exception(regs); irq_exit(); set_irq_regs(old_regs); }

Contributors

PersonTokensPropCommitsCommitProp
Mahesh Salgaonkar46100.00%1100.00%
Total46100.00%1100.00%


void unknown_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, 0, 0); exception_exit(prev_state); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras3774.00%133.33%
Li Zhong1224.00%133.33%
Stephen Rothwell12.00%133.33%
Total50100.00%3100.00%


void instruction_breakpoint_exception(struct pt_regs *regs) { enum ctx_state prev_state = exception_enter(); if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5, 5, SIGTRAP) == NOTIFY_STOP) goto bail; if (debugger_iabr_match(regs)) goto bail; _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip); bail: exception_exit(prev_state); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras4869.57%133.33%
Li Zhong2028.99%133.33%
Stephen Rothwell11.45%133.33%
Total69100.00%3100.00%


void RunModeException(struct pt_regs *regs) { _exception(SIGTRAP, regs, 0, 0); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras21100.00%1100.00%
Total21100.00%1100.00%


void single_step_exception(struct pt_regs *regs) { enum ctx_state prev_state = exception_enter(); clear_single_step(regs); if (kprobe_post_handler(regs)) return; if (notify_die(DIE_SSTEP, "single_step", regs, 5, 5, SIGTRAP) == NOTIFY_STOP) goto bail; if (debugger_sstep(regs)) goto bail; _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); bail: exception_exit(prev_state); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras5060.98%120.00%
Li Zhong2024.39%120.00%
Naveen N. Rao89.76%120.00%
K.Prasad33.66%120.00%
Stephen Rothwell11.22%120.00%
Total82100.00%5100.00%

NOKPROBE_SYMBOL(single_step_exception); /* * After we have successfully emulated an instruction, we have to * check if the instruction was being single-stepped, and if so, * pretend we got a single-step exception. This was pointed out * by Kumar Gala. -- paulus */
static void emulate_single_step(struct pt_regs *regs) { if (single_stepping(regs)) single_step_exception(regs); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mackerras2295.65%150.00%
K.Prasad14.35%150.00%
Total23100.00%2100.00%


static inline int __parse_fpscr(unsigned long fpscr) { int ret = 0;