Exemplo n.º 1
0
void do_report_trap(struct pt_regs *regs, int si_signo, int si_code, char *str)
{
    siginfo_t info;

    if (user_mode(regs)) {
        info.si_signo = si_signo;
        info.si_errno = 0;
        info.si_code = si_code;
        info.si_addr = get_trap_ip(regs);
        force_sig_info(si_signo, &info, current);
        report_user_fault(regs, si_signo);
    } else {
        const struct exception_table_entry *fixup;
        fixup = search_exception_tables(regs->psw.addr & PSW_ADDR_INSN);
        if (fixup)
            regs->psw.addr = extable_fixup(fixup) | PSW_ADDR_AMODE;
        else {
            enum bug_trap_type btt;

            btt = report_bug(regs->psw.addr & PSW_ADDR_INSN, regs);
            if (btt == BUG_TRAP_TYPE_WARN)
                return;
            die(regs, str);
        }
    }
}
Exemplo n.º 2
0
static noinline void do_no_context(struct pt_regs *regs)
{
	const struct exception_table_entry *fixup;
	unsigned long address;

	/* Are we prepared to handle this kernel fault?  */
	fixup = search_exception_tables(regs->psw.addr & PSW_ADDR_INSN);
	if (fixup) {
		regs->psw.addr = extable_fixup(fixup) | PSW_ADDR_AMODE;
		return;
	}

	/*
	 * Oops. The kernel tried to access some bad page. We'll have to
	 * terminate things with extreme prejudice.
	 */
	address = regs->int_parm_long & __FAIL_ADDR_MASK;
	if (!user_space_fault(regs->int_parm_long))
		printk(KERN_ALERT "Unable to handle kernel pointer dereference"
		       " at virtual kernel address %p\n", (void *)address);
	else
		printk(KERN_ALERT "Unable to handle kernel paging request"
		       " at virtual user address %p\n", (void *)address);

	die(regs, "Oops");
	do_exit(SIGKILL);
}
Exemplo n.º 3
0
static noinline void do_no_context(struct pt_regs *regs)
{
	const struct exception_table_entry *fixup;

	/* Are we prepared to handle this kernel fault?  */
	fixup = search_exception_tables(regs->psw.addr);
	if (fixup) {
		regs->psw.addr = extable_fixup(fixup);
		return;
	}

	/*
	 * Oops. The kernel tried to access some bad page. We'll have to
	 * terminate things with extreme prejudice.
	 */
	if (get_fault_type(regs) == KERNEL_FAULT)
		printk(KERN_ALERT "Unable to handle kernel pointer dereference"
		       " in virtual kernel address space\n");
	else
		printk(KERN_ALERT "Unable to handle kernel paging request"
		       " in virtual user address space\n");
	dump_fault_info(regs);
	die(regs, "Oops");
	do_exit(SIGKILL);
}
static int mpc7448_machine_check_exception(struct pt_regs *regs)
{
	const struct exception_table_entry *entry;

	/* Are we prepared to handle this fault */
	if ((entry = search_exception_tables(regs->nip)) != NULL) {
		tsi108_clear_pci_cfg_error();
		regs->msr |= MSR_RI;
		regs->nip = extable_fixup(entry);
		return 1;
	}
	return 0;
}