#include <linux/interrupt.h>
#include <linux/kprobes.h>
#include <linux/kdebug.h>
+#include <linux/percpu.h>
#include <asm/page.h>
#include <asm/pgtable.h>
(fault_code & FAULT_CODE_DTLB))
BUG();
+ if (test_thread_flag(TIF_32BIT)) {
+ if (!(regs->tstate & TSTATE_PRIV))
+ regs->tpc &= 0xffffffff;
+ address &= 0xffffffff;
+ }
+
if (regs->tstate & TSTATE_PRIV) {
- unsigned long tpc = regs->tpc;
+ unsigned long eaddr, tpc = regs->tpc;
/* Sanity check the PC. */
if ((tpc >= KERNBASE && tpc < (unsigned long) __init_end) ||
bad_kernel_pc(regs, address);
return;
}
+
+ insn = get_fault_insn(regs, insn);
+ eaddr = compute_effective_address(regs, insn, 0);
+ if (WARN_ON_ONCE((eaddr & PAGE_MASK) != (address & PAGE_MASK))){
+ printk(KERN_ERR "FAULT: Mismatch kernel fault "
+ "address: addr[%lx] eaddr[%lx] TPC[%lx]\n",
+ address, eaddr, tpc);
+ show_regs(regs);
+ goto handle_kernel_fault;
+ }
}
/*
if (in_atomic() || !mm)
goto intr_or_no_mm;
- if (test_thread_flag(TIF_32BIT)) {
- if (!(regs->tstate & TSTATE_PRIV))
- regs->tpc &= 0xffffffff;
- address &= 0xffffffff;
- }
-
if (!down_read_trylock(&mm->mmap_sem)) {
if ((regs->tstate & TSTATE_PRIV) &&
!search_exception_tables(regs->tpc)) {