17 #include <linux/mman.h>
19 #include <linux/kernel.h>
20 #include <linux/ptrace.h>
23 #include <asm/pgtable.h>
24 #include <asm/uaccess.h>
25 #include <asm/gdb-stub.h>
36 unsigned long _pme, lrai, lrad,
fixup;
45 const char *atxc[16] = {
46 [0x0] =
"mmu-miss", [0x8] =
"multi-dat", [0x9] =
"multi-sat",
47 [0xa] =
"tlb-miss", [0xc] =
"privilege", [0xd] =
"write-prot",
50 printk(
"do_page_fault(%d,%lx [%s],%lx)\n",
51 datammu, esr0, atxc[esr0 >> 20 & 0xf], ear0);
70 goto kernel_pte_fault;
72 goto kernel_pte_fault;
101 if ((ear0 &
PAGE_MASK) + 2 * PAGE_SIZE < __frame->
sp) {
103 printk(
"[%d] ### Access below stack @%lx (sp=%lx)\n",
104 current->pid, ear0, __frame->sp);
106 printk(
"[%d] ### Code: [%08lx] %02x %02x %02x %02x %02x %02x %02x %02x\n",
109 ((
u8*)__frame->pc)[0],
110 ((
u8*)__frame->pc)[1],
111 ((
u8*)__frame->pc)[2],
112 ((
u8*)__frame->pc)[3],
113 ((
u8*)__frame->pc)[4],
114 ((
u8*)__frame->pc)[5],
115 ((
u8*)__frame->pc)[6],
116 ((
u8*)__frame->pc)[7]
133 switch (esr0 & ESR0_ATXC) {
137 #ifdef TEST_VERIFY_AREA
139 printk(
"WP fault at %08lx\n", __frame->pc);
155 if (!(vma->
vm_flags & (VM_READ | VM_WRITE | VM_EXEC)))
166 if (
unlikely(fault & VM_FAULT_ERROR)) {
167 if (fault & VM_FAULT_OOM)
169 else if (fault & VM_FAULT_SIGBUS)
173 if (fault & VM_FAULT_MAJOR)
193 info.si_addr = (
void *) ear0;
216 printk(
" at virtual addr %08lx\n", ear0);
217 printk(
" PC : %08lx\n", __frame->pc);
218 printk(
" EXC : esr0=%08lx ear0=%08lx\n", esr0, ear0);
220 asm(
"lrai %1,%0,#1,#0,#0" :
"=&r"(lrai) :
"r"(ear0));
221 asm(
"lrad %1,%0,#1,#0,#0" :
"=&r"(lrad) :
"r"(ear0));
230 _pme = pue->
pue[0].
ste[0];
235 unsigned long dampr, damlr,
val;
237 asm volatile(
"movsg dampr2,%0 ! movgs %2,dampr2 ! movsg damlr2,%1"
238 :
"=&r"(dampr),
"=r"(damlr)
245 asm volatile(
"movgs %0,dampr2" ::
"r" (dampr));
274 info.si_addr = (
void *) ear0;