/* * This function is protected against re-entrancy. */ void die(const char *str, struct pt_regs *regs, int err) { int ret; unsigned long flags; raw_spin_lock_irqsave(&die_lock, flags); oops_enter(); console_verbose(); bust_spinlocks(1); ret = __die(str, err, regs); if (regs && kexec_should_crash(current)) crash_kexec(regs); bust_spinlocks(0); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); oops_exit(); if (in_interrupt()) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); raw_spin_unlock_irqrestore(&die_lock, flags); if (ret != NOTIFY_STOP) do_exit(SIGSEGV); }
void fiq_die_handler(unsigned int savepc) { /*struct pt_regs r;*/ console_verbose(); printk("PC=0x%08x\n", savepc); /*die("FIQ", &r, 0);*/ }
void __init setup_arch(char **cmdline_p) { *cmdline_p = cmd_line; console_verbose(); unflatten_device_tree(); /* NOTE I think that this function is not necessary to call */ /* irq_early_init(); */ setup_cpuinfo(); microblaze_cache_init(); setup_memory(); #ifdef CONFIG_EARLY_PRINTK /* remap early console to virtual address */ remap_early_printk(); #endif xilinx_pci_init(); #if defined(CONFIG_SELFMOD_INTC) || defined(CONFIG_SELFMOD_TIMER) printk(KERN_NOTICE "Self modified code enable\n"); #endif #ifdef CONFIG_VT #if defined(CONFIG_XILINX_CONSOLE) conswitchp = &xil_con; #elif defined(CONFIG_DUMMY_CONSOLE) conswitchp = &dummy_con; #endif #endif }
/* * bad_mode handles the impossible case in the exception vector. */ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) { siginfo_t info; void __user *pc = (void __user *)instruction_pointer(regs); console_verbose(); #ifdef CONFIG_MEDIATEK_SOLUTION /* * * reason is defined in entry.S, 3 means BAD_ERROR, * * which would be triggered by async abort */ if ((reason == 3) && async_abort_handler) async_abort_handler(regs, async_abort_priv); #endif pr_crit("Bad mode in %s handler detected, code 0x%08x\n", handler[reason], esr); __show_regs(regs); info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; info.si_addr = pc; arm64_notify_die("Oops - bad mode", regs, &info, 0); }
unsigned __kprobes long oops_begin(void) { int cpu; unsigned long flags; trace_hw_branch_oops(); oops_enter(); raw_local_irq_save(flags); cpu = smp_processor_id(); if (!__raw_spin_trylock(&die_lock)) { if (cpu == die_owner) ; else __raw_spin_lock(&die_lock); } die_nest_count++; die_owner = cpu; console_verbose(); bust_spinlocks(1); return flags; }
unsigned __kprobes long oops_begin(void) { int cpu; unsigned long flags; /* notify the hw-branch tracer so it may disable tracing and add the last trace to the trace buffer - the earlier this happens, the more useful the trace. */ trace_hw_branch_oops(); 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); return flags; }
void __init setup_arch(char **cmdline_p) { *cmdline_p = boot_command_line; console_verbose(); unflatten_device_tree(); setup_cpuinfo(); microblaze_cache_init(); setup_memory(); #ifdef CONFIG_EARLY_PRINTK /* remap early console to virtual address */ remap_early_printk(); #endif xilinx_pci_init(); #if defined(CONFIG_DUMMY_CONSOLE) conswitchp = &dummy_con; #endif }
void __init setup_arch(char **cmdline_p) { *cmdline_p = cmd_line; console_verbose(); unflatten_device_tree(); setup_cpuinfo(); microblaze_cache_init(); setup_memory(); #ifdef CONFIG_EARLY_PRINTK /* */ remap_early_printk(); #endif xilinx_pci_init(); #if defined(CONFIG_SELFMOD_INTC) || defined(CONFIG_SELFMOD_TIMER) printk(KERN_NOTICE "Self modified code enable\n"); #endif #ifdef CONFIG_VT #if defined(CONFIG_XILINX_CONSOLE) conswitchp = &xil_con; #elif defined(CONFIG_DUMMY_CONSOLE) conswitchp = &dummy_con; #endif #endif }
void die(struct pt_regs *regs, const char *str) { static int die_counter; oops_enter(); lgr_info_log(); debug_stop_all(); console_verbose(); spin_lock_irq(&die_lock); bust_spinlocks(1); printk("%s: %04x [#%d] ", str, regs->int_code & 0xffff, ++die_counter); #ifdef CONFIG_PREEMPT printk("PREEMPT "); #endif #ifdef CONFIG_SMP printk("SMP "); #endif #ifdef CONFIG_DEBUG_PAGEALLOC printk("DEBUG_PAGEALLOC"); #endif printk("\n"); notify_die(DIE_OOPS, str, regs, 0, regs->int_code & 0xffff, SIGSEGV); print_modules(); show_regs(regs); bust_spinlocks(0); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); spin_unlock_irq(&die_lock); if (in_interrupt()) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception: panic_on_oops"); oops_exit(); do_exit(SIGSEGV); }
void NORET_TYPE die(const char *str, struct pt_regs *regs, long err) { static int die_counter; console_verbose(); spin_lock_irq(&die_lock); bust_spinlocks(1); printk(KERN_ALERT "Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); printk(KERN_EMERG); #ifdef CONFIG_PREEMPT printk(KERN_CONT "PREEMPT "); #endif #ifdef CONFIG_FRAME_POINTER printk(KERN_CONT "FRAME_POINTER "); #endif if (current_cpu_data.features & AVR32_FEATURE_OCD) { unsigned long did = ocd_read(DID); printk(KERN_CONT "chip: 0x%03lx:0x%04lx rev %lu\n", (did >> 1) & 0x7ff, (did >> 12) & 0x7fff, (did >> 28) & 0xf); } else {
asmlinkage void double_fault_c(struct pt_regs *fp) { console_verbose(); oops_in_progress = 1; #ifdef CONFIG_DEBUG_VERBOSE printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n"); #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { unsigned int cpu = smp_processor_id(); char buf[150]; decode_address(buf, cpu_pda[cpu].retx); printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n", (unsigned int)cpu_pda[cpu].seqstat & SEQSTAT_EXCAUSE, buf); decode_address(buf, cpu_pda[cpu].dcplb_fault_addr); printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf); decode_address(buf, cpu_pda[cpu].icplb_fault_addr); printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf); decode_address(buf, fp->retx); printk(KERN_NOTICE "The instruction at %s caused a double exception\n", buf); } else #endif { dump_bfin_process(fp); dump_bfin_mem(fp); show_regs(fp); } #endif panic("Double Fault - unrecoverable event\n"); }
void __noreturn die(const char *str, struct pt_regs *regs, long err, unsigned long addr) { static int die_counter; oops_enter(); spin_lock_irq(&die_lock); console_verbose(); bust_spinlocks(1); pr_err("%s: err %04lx (%s) addr %08lx [#%d]\n", str, err & 0xffff, trap_name(err & 0xffff), addr, ++die_counter); print_modules(); show_regs(regs); pr_err("Process: %s (pid: %d, stack limit = %p)\n", current->comm, task_pid_nr(current), task_stack_page(current) + THREAD_SIZE); bust_spinlocks(0); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); if (kexec_should_crash(current)) crash_kexec(regs); if (in_interrupt()) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); spin_unlock_irq(&die_lock); oops_exit(); do_exit(SIGSEGV); }
/* * This function is protected against re-entrancy. */ void die(const char *str, struct pt_regs *regs, int err) { struct thread_info *thread = current_thread_info(); int ret; oops_enter(); raw_spin_lock_irq(&die_lock); console_verbose(); bust_spinlocks(1); ret = __die(str, err, thread, regs); if (regs && kexec_should_crash(thread->task)) crash_kexec(regs); bust_spinlocks(0); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); raw_spin_unlock_irq(&die_lock); oops_exit(); if (in_interrupt()) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); if (ret != NOTIFY_STOP) do_exit(SIGSEGV); }
/* * This function is protected against re-entrancy. */ void die(const char *str, struct pt_regs *regs, int err) { enum bug_trap_type bug_type = BUG_TRAP_TYPE_NONE; struct thread_info *thread = current_thread_info(); int ret; oops_enter(); raw_spin_lock_irq(&die_lock); console_verbose(); bust_spinlocks(1); if (!user_mode(regs)) bug_type = report_bug(regs->pc, regs); if (bug_type != BUG_TRAP_TYPE_NONE) str = "Oops - BUG"; ret = __die(str, err, thread, regs); if (regs && kexec_should_crash(thread->task)) crash_kexec(regs); bust_spinlocks(0); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); raw_spin_unlock_irq(&die_lock); oops_exit(); if (in_interrupt()) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); if (ret != NOTIFY_STOP) do_exit(SIGSEGV); }
/* * Generic 'turn off all lock debugging' function: */ int debug_locks_off(void) { if (__debug_locks_off()) { if (!debug_locks_silent) { console_verbose(); return 1; } } return 0; }
asmlinkage void double_fault_c(struct pt_regs *fp) { console_verbose(); oops_in_progress = 1; printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n"); dump_bfin_process(fp); dump_bfin_mem(fp); show_regs(fp); panic("Double Fault - unrecoverable event\n"); }
/* * bad_mode handles the impossible case in the exception vector. This is always * fatal. */ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) { console_verbose(); pr_crit("Bad mode in %s handler detected, code 0x%08x -- %s\n", handler[reason], esr, esr_get_class_string(esr)); die("Oops - bad mode", regs, 0); local_irq_disable(); panic("bad mode"); }
/* * Generic 'turn off all lock debugging' function: */ int debug_locks_off(void) { if (__debug_locks_off()) { if (!debug_locks_silent) { oops_in_progress = 1; console_verbose(); return 1; } } return 0; }
void __die(const char *str, struct pt_regs *regs, const char *file, const char *func, unsigned long line) { console_verbose(); printk("%s", str); if (file && func) printk(" in %s:%s, line %ld", file, func, line); printk(":\n"); show_registers(regs); do_exit(SIGSEGV); }
void die(const char * str, struct pt_regs * regs, long err) { console_verbose(); spin_lock_irq(&die_lock); bust_spinlocks(1); printk("%s: %04lx\n", str, err & 0xffff); show_registers(regs); bust_spinlocks(0); spin_unlock_irq(&die_lock); do_exit(SIGSEGV); }
void die(const char *str, struct pt_regs *fp, long err) { console_verbose(); spin_lock_irq(&die_lock); printk(KERN_WARNING "Oops: %s, sig: %ld\n", str, err); show_regs(fp); spin_unlock_irq(&die_lock); /* do_exit() should take care of panic'ing from an interrupt * context so we don't handle it here */ do_exit(err); }
static int __init init_ntfs_fs(void) { /* Comment this if you trust klogd. There are reasons not to trust it */ #if defined(DEBUG) && !defined(MODULE) console_verbose(); #endif printk(KERN_NOTICE "NTFS version " NTFS_VERSION "\n"); SYSCTL(1); ntfs_debug(DEBUG_OTHER, "registering %s\n",ntfs_fs_type.name); /* add this filesystem to the kernel table of filesystems */ return register_filesystem(&ntfs_fs_type); }
void die(char *str, struct pt_regs *fp, int nr) { console_verbose(); pr_err("%s: %08x\n", str, nr); show_regs(fp); pr_err("Process %s (pid: %d, stackpage=%08lx)\n", current->comm, current->pid, (PAGE_SIZE + (unsigned long) current)); dump_stack(); while (1) ; }
void __init setup_arch(char **cmdline_p) { /* This also populates @boot_command_line from /bootargs */ machine_desc = setup_machine_fdt(__dtb_start); if (!machine_desc) panic("Embedded DT invalid\n"); /* Append any u-boot provided cmdline */ #ifdef CONFIG_CMDLINE_UBOOT /* Add a whitespace seperator between the 2 cmdlines */ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); strlcat(boot_command_line, command_line, COMMAND_LINE_SIZE); #endif /* Save unparsed command line copy for /proc/cmdline */ *cmdline_p = boot_command_line; /* To force early parsing of things like mem=xxx */ parse_early_param(); /* Platform/board specific: e.g. early console registration */ if (machine_desc->init_early) machine_desc->init_early(); setup_processor(); #ifdef CONFIG_SMP smp_init_cpus(); #endif setup_arch_memory(); /* copy flat DT out of .init and then unflatten it */ copy_devtree(); unflatten_device_tree(); /* Can be issue if someone passes cmd line arg "ro" * But that is unlikely so keeping it as it is */ root_mountflags &= ~MS_RDONLY; console_verbose(); #if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE) conswitchp = &dummy_con; #endif arc_unwind_init(); arc_unwind_setup(); }
void die(const char *str, struct pt_regs *fp, unsigned long err) { static int diecount; oops_enter(); console_verbose(); spin_lock_irq(&die_lock); report_bug(fp->pc, fp); printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, ++diecount); dump(fp); spin_unlock_irq(&die_lock); do_exit(SIGSEGV); }
/* * note the untimely death of part of the kernel */ void die(const char *str, struct pt_regs *regs, enum exception_code code) { console_verbose(); spin_lock_irq(&die_lock); printk(KERN_EMERG "\n" KERN_EMERG "%s: %04x\n", str, code & 0xffff); show_registers(regs); if (regs->pc >= 0x02000000 && regs->pc < 0x04000000 && (regs->epsw & (EPSW_IM | EPSW_IE)) != (EPSW_IM | EPSW_IE)) { printk(KERN_EMERG "Exception in usermode interrupt handler\n"); printk(KERN_EMERG "\n" KERN_EMERG " Please connect to kernel debugger !!\n"); asm volatile ("0: bra 0b"); }
static int __init ram_console_init(volatile struct ram_console_buffer *buffer, size_t buffer_size, const char *bootinfo, char *old_buf) { #ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION int numerr; uint8_t *par; #endif ram_console_tty_init(); register_console(&ram_console); #ifdef CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE console_verbose(); #endif return 0; }
/* * bad_mode handles the impossible case in the exception vector. */ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) { siginfo_t info; void __user *pc = (void __user *)instruction_pointer(regs); console_verbose(); pr_crit("Bad mode in %s handler detected, code 0x%08x\n", handler[reason], esr); __show_regs(regs); info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; info.si_addr = pc; arm64_notify_die("Oops - bad mode", regs, &info, 0); }
/* This is normally the 'Oops' routine */ void die(const char *str, struct pt_regs *regs, long err) { console_verbose(); printk("\n%s#: %04lx\n", str, err & 0xffff); show_registers(regs); #ifdef CONFIG_JUMP_UPON_UNHANDLED_EXCEPTION printk("\n\nUNHANDLED_EXCEPTION: entering infinite loop\n"); /* shut down interrupts */ local_irq_disable(); __asm__ __volatile__("l.nop 1"); do {} while (1); #endif do_exit(SIGSEGV); }
unsigned long oops_begin(void) { int cpu = safe_smp_processor_id(); unsigned long flags; /* racy, but better than risking deadlock. */ local_irq_save(flags); if (!spin_trylock(&die_lock)) { if (cpu == die_owner) /* nested oops. should stop eventually */; else spin_lock(&die_lock); } die_owner = cpu; console_verbose(); bust_spinlocks(1); return flags; }