# Pastebin xnwlRS8m @@ -214,13 +214,19 @@ asmlinkage void do_page_fault(struct pt_regs *regs) struct task_struct *tsk; struct vm_area_struct *vma; struct mm_struct *mm; - unsigned long addr, cause; + unsigned long addr, addr_new, cause; unsigned int flags = FAULT_FLAG_DEFAULT; int code = SEGV_MAPERR; vm_fault_t fault; cause = regs->cause; addr = regs->badaddr; + addr_new = (long)addr << 16 >> 16; // Sign-extend TVAL + if (addr_new != addr) { + pr_warn("DEBUG %s: cause=0x%lx: TVAL bug detected and fixed: old=0x%lx new=0x%lx", + __func__, cause, addr, addr_new); + } + addr = addr_new; tsk = current; mm = tsk->mm;