blob: 379f7855605554c9ae955cf7ffe44964374f297e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/mm/fault.c
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Modifications for ARM processor (c) 1995-2004 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/module.h>
12#include <linux/signal.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/mm.h>
Russell King67306da2008-12-14 18:01:44 +000014#include <linux/hardirq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/init.h>
Nicolas Pitre25ce1dd2007-12-03 15:21:57 -050016#include <linux/kprobes.h>
Russell King33fa9b12008-09-06 11:35:55 +010017#include <linux/uaccess.h>
Nicolas Pitre252d4c22008-09-11 11:52:02 -040018#include <linux/page-flags.h>
Catalin Marinas412bb0a2009-07-24 12:37:09 +010019#include <linux/sched.h>
Russell King65cec8e2009-08-17 20:02:06 +010020#include <linux/highmem.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22#include <asm/system.h>
23#include <asm/pgtable.h>
24#include <asm/tlbflush.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26#include "fault.h"
27
Russell Kingc88d6aa2009-09-20 12:41:58 +010028/*
Russell Kingdf297bf2009-09-20 13:18:47 +010029 * Fault status register encodings. We steal bit 31 for our own purposes.
Russell Kingc88d6aa2009-09-20 12:41:58 +010030 */
Russell Kingdf297bf2009-09-20 13:18:47 +010031#define FSR_LNX_PF (1 << 31)
Russell Kingc88d6aa2009-09-20 12:41:58 +010032#define FSR_WRITE (1 << 11)
33#define FSR_FS4 (1 << 10)
34#define FSR_FS3_0 (15)
35
36static inline int fsr_fs(unsigned int fsr)
37{
38 return (fsr & FSR_FS3_0) | (fsr & FSR_FS4) >> 6;
39}
40
Catalin Marinas09529f72009-07-24 12:34:55 +010041#ifdef CONFIG_MMU
Nicolas Pitre25ce1dd2007-12-03 15:21:57 -050042
43#ifdef CONFIG_KPROBES
44static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
45{
46 int ret = 0;
47
48 if (!user_mode(regs)) {
49 /* kprobe_running() needs smp_processor_id() */
50 preempt_disable();
51 if (kprobe_running() && kprobe_fault_handler(regs, fsr))
52 ret = 1;
53 preempt_enable();
54 }
55
56 return ret;
57}
58#else
59static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
60{
61 return 0;
62}
63#endif
64
Linus Torvalds1da177e2005-04-16 15:20:36 -070065/*
66 * This is useful to dump out the page tables associated with
67 * 'addr' in mm 'mm'.
68 */
69void show_pte(struct mm_struct *mm, unsigned long addr)
70{
71 pgd_t *pgd;
72
73 if (!mm)
74 mm = &init_mm;
75
76 printk(KERN_ALERT "pgd = %p\n", mm->pgd);
77 pgd = pgd_offset(mm, addr);
78 printk(KERN_ALERT "[%08lx] *pgd=%08lx", addr, pgd_val(*pgd));
79
80 do {
81 pmd_t *pmd;
82 pte_t *pte;
83
84 if (pgd_none(*pgd))
85 break;
86
87 if (pgd_bad(*pgd)) {
88 printk("(bad)");
89 break;
90 }
91
92 pmd = pmd_offset(pgd, addr);
Nicolas Pitreda46c792008-09-30 16:10:11 +010093 if (PTRS_PER_PMD != 1)
94 printk(", *pmd=%08lx", pmd_val(*pmd));
Linus Torvalds1da177e2005-04-16 15:20:36 -070095
96 if (pmd_none(*pmd))
97 break;
98
99 if (pmd_bad(*pmd)) {
100 printk("(bad)");
101 break;
102 }
103
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 /* We must not map this if we have highmem enabled */
Nicolas Pitre252d4c22008-09-11 11:52:02 -0400105 if (PageHighMem(pfn_to_page(pmd_val(*pmd) >> PAGE_SHIFT)))
106 break;
107
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 pte = pte_offset_map(pmd, addr);
109 printk(", *pte=%08lx", pte_val(*pte));
110 printk(", *ppte=%08lx", pte_val(pte[-PTRS_PER_PTE]));
111 pte_unmap(pte);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 } while(0);
113
114 printk("\n");
115}
Catalin Marinas09529f72009-07-24 12:34:55 +0100116#else /* CONFIG_MMU */
117void show_pte(struct mm_struct *mm, unsigned long addr)
118{ }
119#endif /* CONFIG_MMU */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
121/*
122 * Oops. The kernel tried to access some page that wasn't present.
123 */
124static void
125__do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
126 struct pt_regs *regs)
127{
128 /*
129 * Are we prepared to handle this kernel fault?
130 */
131 if (fixup_exception(regs))
132 return;
133
134 /*
135 * No handler, we'll have to terminate things with extreme prejudice.
136 */
137 bust_spinlocks(1);
138 printk(KERN_ALERT
139 "Unable to handle kernel %s at virtual address %08lx\n",
140 (addr < PAGE_SIZE) ? "NULL pointer dereference" :
141 "paging request", addr);
142
143 show_pte(mm, addr);
144 die("Oops", regs, fsr);
145 bust_spinlocks(0);
146 do_exit(SIGKILL);
147}
148
149/*
150 * Something tried to access memory that isn't in our memory map..
151 * User mode accesses just cause a SIGSEGV
152 */
153static void
154__do_user_fault(struct task_struct *tsk, unsigned long addr,
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700155 unsigned int fsr, unsigned int sig, int code,
156 struct pt_regs *regs)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157{
158 struct siginfo si;
159
160#ifdef CONFIG_DEBUG_USER
161 if (user_debug & UDBG_SEGV) {
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700162 printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
163 tsk->comm, sig, addr, fsr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164 show_pte(tsk->mm, addr);
165 show_regs(regs);
166 }
167#endif
168
169 tsk->thread.address = addr;
170 tsk->thread.error_code = fsr;
171 tsk->thread.trap_no = 14;
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700172 si.si_signo = sig;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173 si.si_errno = 0;
174 si.si_code = code;
175 si.si_addr = (void __user *)addr;
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700176 force_sig_info(sig, &si, tsk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177}
178
Russell Kinge5beac32006-09-27 16:13:48 +0100179void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180{
Russell Kinge5beac32006-09-27 16:13:48 +0100181 struct task_struct *tsk = current;
182 struct mm_struct *mm = tsk->active_mm;
183
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184 /*
185 * If we are in kernel mode at this point, we
186 * have no context to handle this fault with.
187 */
188 if (user_mode(regs))
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700189 __do_user_fault(tsk, addr, fsr, SIGSEGV, SEGV_MAPERR, regs);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190 else
191 __do_kernel_fault(mm, addr, fsr, regs);
192}
193
Catalin Marinas09529f72009-07-24 12:34:55 +0100194#ifdef CONFIG_MMU
Nick Piggin5c72fc52007-07-20 09:21:06 +0200195#define VM_FAULT_BADMAP 0x010000
196#define VM_FAULT_BADACCESS 0x020000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197
Russell Kingd374bf12009-09-20 12:53:01 +0100198/*
199 * Check that the permissions on the VMA allow for the fault which occurred.
200 * If we encountered a write fault, we must have write permission, otherwise
201 * we allow any permission.
202 */
203static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
204{
205 unsigned int mask = VM_READ | VM_WRITE | VM_EXEC;
206
207 if (fsr & FSR_WRITE)
208 mask = VM_WRITE;
Russell Kingdf297bf2009-09-20 13:18:47 +0100209 if (fsr & FSR_LNX_PF)
210 mask = VM_EXEC;
Russell Kingd374bf12009-09-20 12:53:01 +0100211
212 return vma->vm_flags & mask ? false : true;
213}
214
215static int __kprobes
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
217 struct task_struct *tsk)
218{
219 struct vm_area_struct *vma;
Russell Kingd374bf12009-09-20 12:53:01 +0100220 int fault;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
222 vma = find_vma(mm, addr);
223 fault = VM_FAULT_BADMAP;
Russell Kingd374bf12009-09-20 12:53:01 +0100224 if (unlikely(!vma))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 goto out;
Russell Kingd374bf12009-09-20 12:53:01 +0100226 if (unlikely(vma->vm_start > addr))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700227 goto check_stack;
228
229 /*
230 * Ok, we have a good vm_area for this
231 * memory access, so we can handle it.
232 */
233good_area:
Russell Kingd374bf12009-09-20 12:53:01 +0100234 if (access_error(fsr, vma)) {
235 fault = VM_FAULT_BADACCESS;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 goto out;
Russell Kingd374bf12009-09-20 12:53:01 +0100237 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238
239 /*
Russell Kingb42c6342009-09-20 12:47:40 +0100240 * If for any reason at all we couldn't handle the fault, make
241 * sure we exit gracefully rather than endlessly redo the fault.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 */
Russell Kingc88d6aa2009-09-20 12:41:58 +0100243 fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, (fsr & FSR_WRITE) ? FAULT_FLAG_WRITE : 0);
Russell Kingb42c6342009-09-20 12:47:40 +0100244 if (unlikely(fault & VM_FAULT_ERROR))
245 return fault;
Nick Piggin83c54072007-07-19 01:47:05 -0700246 if (fault & VM_FAULT_MAJOR)
247 tsk->maj_flt++;
248 else
249 tsk->min_flt++;
250 return fault;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252check_stack:
253 if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
254 goto good_area;
255out:
256 return fault;
257}
258
Nicolas Pitre785d3cd2007-12-03 15:27:56 -0500259static int __kprobes
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
261{
262 struct task_struct *tsk;
263 struct mm_struct *mm;
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700264 int fault, sig, code;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265
Nicolas Pitre25ce1dd2007-12-03 15:21:57 -0500266 if (notify_page_fault(regs, fsr))
267 return 0;
268
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269 tsk = current;
270 mm = tsk->mm;
271
272 /*
273 * If we're in an interrupt or have no user
274 * context, we must not take the fault..
275 */
Peter Zijlstra6edaf682006-12-06 20:32:18 -0800276 if (in_atomic() || !mm)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 goto no_context;
278
Russell King840ff6a2005-09-20 17:52:13 +0100279 /*
280 * As per x86, we may deadlock here. However, since the kernel only
281 * validly references user space from well defined areas of the code,
282 * we can bug out early if this is from code which shouldn't.
283 */
284 if (!down_read_trylock(&mm->mmap_sem)) {
285 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
286 goto no_context;
287 down_read(&mm->mmap_sem);
Russell Kingbf4569922009-09-20 12:52:19 +0100288 } else {
289 /*
290 * The above down_read_trylock() might have succeeded in
291 * which case, we'll have missed the might_sleep() from
292 * down_read()
293 */
294 might_sleep();
Russell King840ff6a2005-09-20 17:52:13 +0100295 }
296
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297 fault = __do_page_fault(mm, addr, fsr, tsk);
298 up_read(&mm->mmap_sem);
299
300 /*
Russell Kingff2afb92005-08-04 14:17:33 +0100301 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 */
Nick Piggin5c72fc52007-07-20 09:21:06 +0200303 if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP | VM_FAULT_BADACCESS))))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304 return 0;
305
Russell Kingb42c6342009-09-20 12:47:40 +0100306 if (fault & VM_FAULT_OOM) {
307 /*
308 * We ran out of memory, call the OOM killer, and return to
309 * userspace (which will retry the fault, or kill us if we
310 * got oom-killed)
311 */
312 pagefault_out_of_memory();
313 return 0;
314 }
315
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 * If we are in kernel mode at this point, we
318 * have no context to handle this fault with.
319 */
320 if (!user_mode(regs))
321 goto no_context;
322
Nick Piggin83c54072007-07-19 01:47:05 -0700323 if (fault & VM_FAULT_SIGBUS) {
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700324 /*
325 * We had some memory, but were unable to
326 * successfully fix up this page fault.
327 */
328 sig = SIGBUS;
329 code = BUS_ADRERR;
Nick Piggin83c54072007-07-19 01:47:05 -0700330 } else {
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700331 /*
332 * Something tried to access memory that
333 * isn't in our memory map..
334 */
335 sig = SIGSEGV;
336 code = fault == VM_FAULT_BADACCESS ?
337 SEGV_ACCERR : SEGV_MAPERR;
akpm@osdl.org2d137c22005-04-16 15:23:55 -0700338 }
339
340 __do_user_fault(tsk, addr, fsr, sig, code, regs);
341 return 0;
342
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343no_context:
344 __do_kernel_fault(mm, addr, fsr, regs);
345 return 0;
346}
Catalin Marinas09529f72009-07-24 12:34:55 +0100347#else /* CONFIG_MMU */
348static int
349do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
350{
351 return 0;
352}
353#endif /* CONFIG_MMU */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354
355/*
356 * First Level Translation Fault Handler
357 *
358 * We enter here because the first level page table doesn't contain
359 * a valid entry for the address.
360 *
361 * If the address is in kernel space (>= TASK_SIZE), then we are
362 * probably faulting in the vmalloc() area.
363 *
364 * If the init_task's first level page tables contains the relevant
365 * entry, we copy the it to this task. If not, we send the process
366 * a signal, fixup the exception, or oops the kernel.
367 *
368 * NOTE! We MUST NOT take any locks for this case. We may be in an
369 * interrupt or a critical region, and should only copy the information
370 * from the master page table, nothing more.
371 */
Catalin Marinas09529f72009-07-24 12:34:55 +0100372#ifdef CONFIG_MMU
Nicolas Pitre785d3cd2007-12-03 15:27:56 -0500373static int __kprobes
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374do_translation_fault(unsigned long addr, unsigned int fsr,
375 struct pt_regs *regs)
376{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377 unsigned int index;
378 pgd_t *pgd, *pgd_k;
379 pmd_t *pmd, *pmd_k;
380
381 if (addr < TASK_SIZE)
382 return do_page_fault(addr, fsr, regs);
383
384 index = pgd_index(addr);
385
386 /*
387 * FIXME: CP15 C1 is write only on ARMv3 architectures.
388 */
389 pgd = cpu_get_pgd() + index;
390 pgd_k = init_mm.pgd + index;
391
392 if (pgd_none(*pgd_k))
393 goto bad_area;
394
395 if (!pgd_present(*pgd))
396 set_pgd(pgd, *pgd_k);
397
398 pmd_k = pmd_offset(pgd_k, addr);
399 pmd = pmd_offset(pgd, addr);
400
401 if (pmd_none(*pmd_k))
402 goto bad_area;
403
404 copy_pmd(pmd, pmd_k);
405 return 0;
406
407bad_area:
Russell Kinge5beac32006-09-27 16:13:48 +0100408 do_bad_area(addr, fsr, regs);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409 return 0;
410}
Catalin Marinas09529f72009-07-24 12:34:55 +0100411#else /* CONFIG_MMU */
412static int
413do_translation_fault(unsigned long addr, unsigned int fsr,
414 struct pt_regs *regs)
415{
416 return 0;
417}
418#endif /* CONFIG_MMU */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
420/*
421 * Some section permission faults need to be handled gracefully.
422 * They can happen due to a __{get,put}_user during an oops.
423 */
424static int
425do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
426{
Russell Kinge5beac32006-09-27 16:13:48 +0100427 do_bad_area(addr, fsr, regs);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 return 0;
429}
430
431/*
432 * This abort handler always returns "fault".
433 */
434static int
435do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
436{
437 return 1;
438}
439
440static struct fsr_info {
441 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
442 int sig;
Russell Kingcfb08102005-06-30 11:06:49 +0100443 int code;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444 const char *name;
445} fsr_info[] = {
446 /*
447 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5
448 * defines these to be "precise" aborts.
449 */
Russell Kingcfb08102005-06-30 11:06:49 +0100450 { do_bad, SIGSEGV, 0, "vector exception" },
451 { do_bad, SIGILL, BUS_ADRALN, "alignment exception" },
452 { do_bad, SIGKILL, 0, "terminal exception" },
453 { do_bad, SIGILL, BUS_ADRALN, "alignment exception" },
454 { do_bad, SIGBUS, 0, "external abort on linefetch" },
455 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
456 { do_bad, SIGBUS, 0, "external abort on linefetch" },
457 { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
458 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
459 { do_bad, SIGSEGV, SEGV_ACCERR, "section domain fault" },
460 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
461 { do_bad, SIGSEGV, SEGV_ACCERR, "page domain fault" },
462 { do_bad, SIGBUS, 0, "external abort on translation" },
463 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "section permission fault" },
464 { do_bad, SIGBUS, 0, "external abort on translation" },
465 { do_page_fault, SIGSEGV, SEGV_ACCERR, "page permission fault" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700466 /*
467 * The following are "imprecise" aborts, which are signalled by bit
468 * 10 of the FSR, and may not be recoverable. These are only
469 * supported if the CPU abort handler supports bit 10.
470 */
Russell Kingcfb08102005-06-30 11:06:49 +0100471 { do_bad, SIGBUS, 0, "unknown 16" },
472 { do_bad, SIGBUS, 0, "unknown 17" },
473 { do_bad, SIGBUS, 0, "unknown 18" },
474 { do_bad, SIGBUS, 0, "unknown 19" },
475 { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
476 { do_bad, SIGBUS, 0, "unknown 21" },
477 { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
478 { do_bad, SIGBUS, 0, "unknown 23" },
479 { do_bad, SIGBUS, 0, "dcache parity error" }, /* xscale */
480 { do_bad, SIGBUS, 0, "unknown 25" },
481 { do_bad, SIGBUS, 0, "unknown 26" },
482 { do_bad, SIGBUS, 0, "unknown 27" },
483 { do_bad, SIGBUS, 0, "unknown 28" },
484 { do_bad, SIGBUS, 0, "unknown 29" },
485 { do_bad, SIGBUS, 0, "unknown 30" },
486 { do_bad, SIGBUS, 0, "unknown 31" }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700487};
488
489void __init
490hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
491 int sig, const char *name)
492{
493 if (nr >= 0 && nr < ARRAY_SIZE(fsr_info)) {
494 fsr_info[nr].fn = fn;
495 fsr_info[nr].sig = sig;
496 fsr_info[nr].name = name;
497 }
498}
499
500/*
501 * Dispatch a data abort to the relevant handler.
502 */
Russell King7ab3f8d2007-03-02 15:01:36 +0000503asmlinkage void __exception
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
505{
Russell Kingc88d6aa2009-09-20 12:41:58 +0100506 const struct fsr_info *inf = fsr_info + fsr_fs(fsr);
Russell Kingcfb08102005-06-30 11:06:49 +0100507 struct siginfo info;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508
Russell Kingdf297bf2009-09-20 13:18:47 +0100509 if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510 return;
511
512 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
513 inf->name, fsr, addr);
Russell Kingcfb08102005-06-30 11:06:49 +0100514
515 info.si_signo = inf->sig;
516 info.si_errno = 0;
517 info.si_code = inf->code;
518 info.si_addr = (void __user *)addr;
Christoph Hellwig1eeb66a2007-05-08 00:27:03 -0700519 arm_notify_die("", regs, &info, fsr, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520}
521
Russell King7ab3f8d2007-03-02 15:01:36 +0000522asmlinkage void __exception
Linus Torvalds1da177e2005-04-16 15:20:36 -0700523do_PrefetchAbort(unsigned long addr, struct pt_regs *regs)
524{
Russell Kingdf297bf2009-09-20 13:18:47 +0100525 do_translation_fault(addr, FSR_LNX_PF, regs);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700526}
527