13 #include <linux/module.h>
18 #include <asm/mmu_context.h>
21 #include <asm/uaccess.h>
36 static inline int notify_page_fault(
struct pt_regs *regs,
int trap)
67 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
69 if (notify_page_fault(regs, ecr))
117 if (!(vma->
vm_flags & (VM_READ | VM_WRITE | VM_EXEC)))
124 flags |= FAULT_FLAG_WRITE;
127 panic(
"Unhandled case %lu in do_page_fault!", ecr);
137 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(
current))
140 if (
unlikely(fault & VM_FAULT_ERROR)) {
141 if (fault & VM_FAULT_OOM)
143 else if (fault & VM_FAULT_SIGBUS)
148 if (flags & FAULT_FLAG_ALLOW_RETRY) {
149 if (fault & VM_FAULT_MAJOR)
153 if (fault & VM_FAULT_RETRY) {
154 flags &= ~FAULT_FLAG_ALLOW_RETRY;
155 flags |= FAULT_FLAG_TRIED;
177 if (exception_trace && printk_ratelimit())
178 printk(
"%s%s[%d]: segfault at %08lx pc %08lx "
179 "sp %08lx ecr %lu\n",
201 "Unable to handle kernel NULL pointer dereference");
204 "Unable to handle kernel paging request");
205 printk(
" at virtual address %08lx\n", address);
212 page = ((
unsigned long *)page)[address >> 22];
213 printk(
" pgd = %08lx", page);
216 address &= 0x003ff000;
218 printk(
" pte = %08lx", page);
222 die(
"Kernel access of bad area", regs, signr);
246 printk(
"%s%s[%d]: bus error at %08lx pc %08lx "
247 "sp %08lx ecr %lu\n",
259 "Bus error at physical address 0x%08lx (%s access)\n",
260 addr, write_access ?
"write" :
"read");