import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mm / fault.c
CommitLineData
1da177e4
LT
1/*
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 */
1da177e4
LT
11#include <linux/module.h>
12#include <linux/signal.h>
1da177e4 13#include <linux/mm.h>
67306da6 14#include <linux/hardirq.h>
1da177e4 15#include <linux/init.h>
25ce1dd7 16#include <linux/kprobes.h>
33fa9b13 17#include <linux/uaccess.h>
252d4c27 18#include <linux/page-flags.h>
412bb0a6 19#include <linux/sched.h>
65cec8e3 20#include <linux/highmem.h>
7ada189f 21#include <linux/perf_event.h>
6fa3eb70 22#include <linux/aee.h>
1da177e4 23
5a567d78 24#include <asm/exception.h>
1da177e4 25#include <asm/pgtable.h>
9f97da78
DH
26#include <asm/system_misc.h>
27#include <asm/system_info.h>
1da177e4 28#include <asm/tlbflush.h>
1da177e4
LT
29
30#include "fault.h"
31
09529f7a 32#ifdef CONFIG_MMU
25ce1dd7
NP
33
34#ifdef CONFIG_KPROBES
35static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
36{
37 int ret = 0;
38
39 if (!user_mode(regs)) {
40 /* kprobe_running() needs smp_processor_id() */
41 preempt_disable();
42 if (kprobe_running() && kprobe_fault_handler(regs, fsr))
43 ret = 1;
44 preempt_enable();
45 }
46
47 return ret;
48}
49#else
50static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
51{
52 return 0;
53}
54#endif
55
1da177e4
LT
56/*
57 * This is useful to dump out the page tables associated with
58 * 'addr' in mm 'mm'.
59 */
60void show_pte(struct mm_struct *mm, unsigned long addr)
61{
62 pgd_t *pgd;
63
64 if (!mm)
65 mm = &init_mm;
66
67 printk(KERN_ALERT "pgd = %p\n", mm->pgd);
68 pgd = pgd_offset(mm, addr);
29a38193
WD
69 printk(KERN_ALERT "[%08lx] *pgd=%08llx",
70 addr, (long long)pgd_val(*pgd));
1da177e4
LT
71
72 do {
516295e5 73 pud_t *pud;
1da177e4
LT
74 pmd_t *pmd;
75 pte_t *pte;
76
77 if (pgd_none(*pgd))
78 break;
79
80 if (pgd_bad(*pgd)) {
81 printk("(bad)");
82 break;
83 }
84
516295e5
RK
85 pud = pud_offset(pgd, addr);
86 if (PTRS_PER_PUD != 1)
140d5dc1 87 printk(", *pud=%08llx", (long long)pud_val(*pud));
516295e5
RK
88
89 if (pud_none(*pud))
90 break;
91
92 if (pud_bad(*pud)) {
93 printk("(bad)");
94 break;
95 }
96
97 pmd = pmd_offset(pud, addr);
da46c79a 98 if (PTRS_PER_PMD != 1)
29a38193 99 printk(", *pmd=%08llx", (long long)pmd_val(*pmd));
1da177e4
LT
100
101 if (pmd_none(*pmd))
102 break;
103
104 if (pmd_bad(*pmd)) {
105 printk("(bad)");
106 break;
107 }
108
1da177e4 109 /* We must not map this if we have highmem enabled */
252d4c27
NP
110 if (PageHighMem(pfn_to_page(pmd_val(*pmd) >> PAGE_SHIFT)))
111 break;
112
1da177e4 113 pte = pte_offset_map(pmd, addr);
29a38193 114 printk(", *pte=%08llx", (long long)pte_val(*pte));
f7b8156d 115#ifndef CONFIG_ARM_LPAE
29a38193
WD
116 printk(", *ppte=%08llx",
117 (long long)pte_val(pte[PTE_HWTABLE_PTRS]));
f7b8156d 118#endif
1da177e4 119 pte_unmap(pte);
1da177e4
LT
120 } while(0);
121
122 printk("\n");
123}
09529f7a
CM
124#else /* CONFIG_MMU */
125void show_pte(struct mm_struct *mm, unsigned long addr)
126{ }
127#endif /* CONFIG_MMU */
1da177e4
LT
128
129/*
130 * Oops. The kernel tried to access some page that wasn't present.
131 */
132static void
133__do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
134 struct pt_regs *regs)
135{
136 /*
137 * Are we prepared to handle this kernel fault?
138 */
139 if (fixup_exception(regs))
140 return;
141
142 /*
143 * No handler, we'll have to terminate things with extreme prejudice.
144 */
145 bust_spinlocks(1);
146 printk(KERN_ALERT
147 "Unable to handle kernel %s at virtual address %08lx\n",
148 (addr < PAGE_SIZE) ? "NULL pointer dereference" :
149 "paging request", addr);
150
151 show_pte(mm, addr);
152 die("Oops", regs, fsr);
153 bust_spinlocks(0);
154 do_exit(SIGKILL);
155}
156
157/*
158 * Something tried to access memory that isn't in our memory map..
159 * User mode accesses just cause a SIGSEGV
160 */
161static void
162__do_user_fault(struct task_struct *tsk, unsigned long addr,
2d137c24
AM
163 unsigned int fsr, unsigned int sig, int code,
164 struct pt_regs *regs)
1da177e4
LT
165{
166 struct siginfo si;
167
168#ifdef CONFIG_DEBUG_USER
f5274c2d
JM
169 if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
170 ((user_debug & UDBG_BUS) && (sig == SIGBUS))) {
2d137c24
AM
171 printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
172 tsk->comm, sig, addr, fsr);
1da177e4
LT
173 show_pte(tsk->mm, addr);
174 show_regs(regs);
175 }
176#endif
177
178 tsk->thread.address = addr;
179 tsk->thread.error_code = fsr;
180 tsk->thread.trap_no = 14;
2d137c24 181 si.si_signo = sig;
1da177e4
LT
182 si.si_errno = 0;
183 si.si_code = code;
184 si.si_addr = (void __user *)addr;
2d137c24 185 force_sig_info(sig, &si, tsk);
1da177e4
LT
186}
187
e5beac37 188void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
1da177e4 189{
e5beac37
RK
190 struct task_struct *tsk = current;
191 struct mm_struct *mm = tsk->active_mm;
192
1da177e4
LT
193 /*
194 * If we are in kernel mode at this point, we
195 * have no context to handle this fault with.
196 */
197 if (user_mode(regs))
2d137c24 198 __do_user_fault(tsk, addr, fsr, SIGSEGV, SEGV_MAPERR, regs);
1da177e4
LT
199 else
200 __do_kernel_fault(mm, addr, fsr, regs);
201}
202
09529f7a 203#ifdef CONFIG_MMU
5c72fc5c
NP
204#define VM_FAULT_BADMAP 0x010000
205#define VM_FAULT_BADACCESS 0x020000
1da177e4 206
d374bf14
RK
207/*
208 * Check that the permissions on the VMA allow for the fault which occurred.
209 * If we encountered a write fault, we must have write permission, otherwise
210 * we allow any permission.
211 */
212static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
213{
214 unsigned int mask = VM_READ | VM_WRITE | VM_EXEC;
215
216 if (fsr & FSR_WRITE)
217 mask = VM_WRITE;
df297bf6
RK
218 if (fsr & FSR_LNX_PF)
219 mask = VM_EXEC;
d374bf14
RK
220
221 return vma->vm_flags & mask ? false : true;
222}
223
224static int __kprobes
1da177e4 225__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
8878a539 226 unsigned int flags, struct task_struct *tsk)
1da177e4
LT
227{
228 struct vm_area_struct *vma;
d374bf14 229 int fault;
1da177e4
LT
230
231 vma = find_vma(mm, addr);
232 fault = VM_FAULT_BADMAP;
d374bf14 233 if (unlikely(!vma))
1da177e4 234 goto out;
d374bf14 235 if (unlikely(vma->vm_start > addr))
1da177e4
LT
236 goto check_stack;
237
238 /*
239 * Ok, we have a good vm_area for this
240 * memory access, so we can handle it.
241 */
242good_area:
d374bf14
RK
243 if (access_error(fsr, vma)) {
244 fault = VM_FAULT_BADACCESS;
1da177e4 245 goto out;
d374bf14 246 }
1da177e4 247
8878a539 248 return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags);
1da177e4 249
1da177e4 250check_stack:
9b61a4d1
RK
251 /* Don't allow expansion below FIRST_USER_ADDRESS */
252 if (vma->vm_flags & VM_GROWSDOWN &&
253 addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr))
1da177e4
LT
254 goto good_area;
255out:
256 return fault;
257}
258
785d3cd2 259static int __kprobes
1da177e4
LT
260do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
261{
262 struct task_struct *tsk;
263 struct mm_struct *mm;
2d137c24 264 int fault, sig, code;
8878a539
KC
265 int write = fsr & FSR_WRITE;
266 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
267 (write ? FAULT_FLAG_WRITE : 0);
1da177e4 268
25ce1dd7
NP
269 if (notify_page_fault(regs, fsr))
270 return 0;
271
1da177e4
LT
272 tsk = current;
273 mm = tsk->mm;
274
02fe2845
RK
275 /* Enable interrupts if they were enabled in the parent context. */
276 if (interrupts_enabled(regs))
277 local_irq_enable();
278
1da177e4 279 /*
6fa3eb70 280 * If we're in an interrupt, or have no irqs, or have no user
1da177e4
LT
281 * context, we must not take the fault..
282 */
6fa3eb70 283 if (in_atomic() || irqs_disabled() || !mm)
1da177e4
LT
284 goto no_context;
285
840ff6a4
RK
286 /*
287 * As per x86, we may deadlock here. However, since the kernel only
288 * validly references user space from well defined areas of the code,
289 * we can bug out early if this is from code which shouldn't.
290 */
291 if (!down_read_trylock(&mm->mmap_sem)) {
292 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
293 goto no_context;
8878a539 294retry:
840ff6a4 295 down_read(&mm->mmap_sem);
bf456992
RK
296 } else {
297 /*
298 * The above down_read_trylock() might have succeeded in
299 * which case, we'll have missed the might_sleep() from
300 * down_read()
301 */
302 might_sleep();
1d212712
ID
303#ifdef CONFIG_DEBUG_VM
304 if (!user_mode(regs) &&
305 !search_exception_tables(regs->ARM_pc))
306 goto no_context;
307#endif
840ff6a4
RK
308 }
309
8878a539
KC
310 fault = __do_page_fault(mm, addr, fsr, flags, tsk);
311
312 /* If we need to retry but a fatal signal is pending, handle the
313 * signal first. We do not need to release the mmap_sem because
314 * it would already be released in __lock_page_or_retry in
315 * mm/filemap.c. */
316 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
317 return 0;
318
319 /*
320 * Major/minor page fault accounting is only done on the
321 * initial attempt. If we go through a retry, it is extremely
322 * likely that the page will be found in page cache at that point.
323 */
1da177e4 324
a8b0ca17 325 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
dff2aa7a 326 if (!(fault & VM_FAULT_ERROR) && flags & FAULT_FLAG_ALLOW_RETRY) {
8878a539
KC
327 if (fault & VM_FAULT_MAJOR) {
328 tsk->maj_flt++;
329 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
330 regs, addr);
331 } else {
332 tsk->min_flt++;
333 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
334 regs, addr);
335 }
336 if (fault & VM_FAULT_RETRY) {
337 /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
338 * of starvation. */
339 flags &= ~FAULT_FLAG_ALLOW_RETRY;
45cac65b 340 flags |= FAULT_FLAG_TRIED;
8878a539
KC
341 goto retry;
342 }
343 }
344
345 up_read(&mm->mmap_sem);
7ada189f 346
1da177e4 347 /*
ff2afb9d 348 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
1da177e4 349 */
5c72fc5c 350 if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP | VM_FAULT_BADACCESS))))
1da177e4
LT
351 return 0;
352
b42c6344
RK
353 if (fault & VM_FAULT_OOM) {
354 /*
355 * We ran out of memory, call the OOM killer, and return to
356 * userspace (which will retry the fault, or kill us if we
357 * got oom-killed)
358 */
359 pagefault_out_of_memory();
360 return 0;
361 }
362
1da177e4
LT
363 /*
364 * If we are in kernel mode at this point, we
365 * have no context to handle this fault with.
366 */
367 if (!user_mode(regs))
368 goto no_context;
369
83c54070 370 if (fault & VM_FAULT_SIGBUS) {
2d137c24
AM
371 /*
372 * We had some memory, but were unable to
373 * successfully fix up this page fault.
374 */
375 sig = SIGBUS;
376 code = BUS_ADRERR;
83c54070 377 } else {
2d137c24
AM
378 /*
379 * Something tried to access memory that
380 * isn't in our memory map..
381 */
382 sig = SIGSEGV;
383 code = fault == VM_FAULT_BADACCESS ?
384 SEGV_ACCERR : SEGV_MAPERR;
1da177e4 385 }
1da177e4 386
2d137c24
AM
387 __do_user_fault(tsk, addr, fsr, sig, code, regs);
388 return 0;
1da177e4
LT
389
390no_context:
391 __do_kernel_fault(mm, addr, fsr, regs);
392 return 0;
393}
09529f7a
CM
394#else /* CONFIG_MMU */
395static int
396do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
397{
398 return 0;
399}
400#endif /* CONFIG_MMU */
1da177e4
LT
401
402/*
403 * First Level Translation Fault Handler
404 *
405 * We enter here because the first level page table doesn't contain
406 * a valid entry for the address.
407 *
408 * If the address is in kernel space (>= TASK_SIZE), then we are
409 * probably faulting in the vmalloc() area.
410 *
411 * If the init_task's first level page tables contains the relevant
412 * entry, we copy the it to this task. If not, we send the process
413 * a signal, fixup the exception, or oops the kernel.
414 *
415 * NOTE! We MUST NOT take any locks for this case. We may be in an
416 * interrupt or a critical region, and should only copy the information
417 * from the master page table, nothing more.
418 */
09529f7a 419#ifdef CONFIG_MMU
785d3cd2 420static int __kprobes
1da177e4
LT
421do_translation_fault(unsigned long addr, unsigned int fsr,
422 struct pt_regs *regs)
423{
1da177e4
LT
424 unsigned int index;
425 pgd_t *pgd, *pgd_k;
516295e5 426 pud_t *pud, *pud_k;
1da177e4
LT
427 pmd_t *pmd, *pmd_k;
428
429 if (addr < TASK_SIZE)
430 return do_page_fault(addr, fsr, regs);
431
5e27fb78
A
432 if (user_mode(regs))
433 goto bad_area;
434
1da177e4
LT
435 index = pgd_index(addr);
436
1da177e4
LT
437 pgd = cpu_get_pgd() + index;
438 pgd_k = init_mm.pgd + index;
439
440 if (pgd_none(*pgd_k))
441 goto bad_area;
1da177e4
LT
442 if (!pgd_present(*pgd))
443 set_pgd(pgd, *pgd_k);
444
516295e5
RK
445 pud = pud_offset(pgd, addr);
446 pud_k = pud_offset(pgd_k, addr);
447
448 if (pud_none(*pud_k))
449 goto bad_area;
450 if (!pud_present(*pud))
451 set_pud(pud, *pud_k);
452
453 pmd = pmd_offset(pud, addr);
454 pmd_k = pmd_offset(pud_k, addr);
1da177e4 455
f7b8156d
CM
456#ifdef CONFIG_ARM_LPAE
457 /*
458 * Only one hardware entry per PMD with LPAE.
459 */
460 index = 0;
461#else
33a9c41b
KS
462 /*
463 * On ARM one Linux PGD entry contains two hardware entries (see page
464 * tables layout in pgtable.h). We normally guarantee that we always
465 * fill both L1 entries. But create_mapping() doesn't follow the rule.
466 * It can create inidividual L1 entries, so here we have to call
467 * pmd_none() check for the entry really corresponded to address, not
468 * for the first of pair.
469 */
470 index = (addr >> SECTION_SHIFT) & 1;
f7b8156d 471#endif
33a9c41b 472 if (pmd_none(pmd_k[index]))
1da177e4
LT
473 goto bad_area;
474
475 copy_pmd(pmd, pmd_k);
476 return 0;
477
478bad_area:
e5beac37 479 do_bad_area(addr, fsr, regs);
1da177e4
LT
480 return 0;
481}
09529f7a
CM
482#else /* CONFIG_MMU */
483static int
484do_translation_fault(unsigned long addr, unsigned int fsr,
485 struct pt_regs *regs)
486{
487 return 0;
488}
489#endif /* CONFIG_MMU */
1da177e4
LT
490
491/*
492 * Some section permission faults need to be handled gracefully.
493 * They can happen due to a __{get,put}_user during an oops.
494 */
495static int
496do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
497{
e5beac37 498 do_bad_area(addr, fsr, regs);
1da177e4
LT
499 return 0;
500}
501
502/*
503 * This abort handler always returns "fault".
504 */
505static int
506do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
507{
508 return 1;
509}
510
136848d4 511struct fsr_info {
1da177e4
LT
512 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
513 int sig;
cfb0810e 514 int code;
1da177e4 515 const char *name;
1da177e4
LT
516};
517
136848d4 518/* FSR definition */
f7b8156d
CM
519#ifdef CONFIG_ARM_LPAE
520#include "fsr-3level.c"
521#else
136848d4 522#include "fsr-2level.c"
f7b8156d 523#endif
136848d4 524
6fa3eb70 525void
1da177e4 526hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
6338a6aa 527 int sig, int code, const char *name)
1da177e4 528{
6338a6aa
KS
529 if (nr < 0 || nr >= ARRAY_SIZE(fsr_info))
530 BUG();
531
532 fsr_info[nr].fn = fn;
533 fsr_info[nr].sig = sig;
534 fsr_info[nr].code = code;
535 fsr_info[nr].name = name;
1da177e4 536}
6fa3eb70 537EXPORT_SYMBOL(hook_fault_code);
1da177e4
LT
538
539/*
540 * Dispatch a data abort to the relevant handler.
541 */
7ab3f8d5 542asmlinkage void __exception
1da177e4
LT
543do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
544{
6fa3eb70
S
545 struct thread_info *thread = current_thread_info();
546 int ret;
c88d6aa7 547 const struct fsr_info *inf = fsr_info + fsr_fs(fsr);
cfb0810e 548 struct siginfo info;
1da177e4 549
6fa3eb70
S
550 if (!user_mode(regs)) {
551 thread->cpu_excp++;
552 if (thread->cpu_excp == 1) {
553 thread->regs_on_excp = (void *)regs;
554 aee_excp_regs = (void*)regs;
555 }
556 /*
557 * NoteXXX: The data abort exception may happen twice
558 * when calling probe_kernel_address() in which.
559 * __copy_from_user_inatomic() is used and the
560 * fixup table lookup may be performed.
561 * Check if the nested panic happens via
562 * (cpu_excp >= 3).
563 */
564 if (thread->cpu_excp >= 3) {
565 aee_stop_nested_panic(regs);
566 }
567 }
568
569 ret = inf->fn(addr, fsr & ~FSR_LNX_PF, regs);
570 if (!ret) {
571 if (!user_mode(regs)) {
572 thread->cpu_excp--;
573 }
1da177e4 574 return;
6fa3eb70 575 }
1da177e4
LT
576
577 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
578 inf->name, fsr, addr);
cfb0810e
RK
579
580 info.si_signo = inf->sig;
581 info.si_errno = 0;
582 info.si_code = inf->code;
583 info.si_addr = (void __user *)addr;
1eeb66a1 584 arm_notify_die("", regs, &info, fsr, 0);
1da177e4
LT
585}
586
3a4b5dca
WD
587void __init
588hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
589 int sig, int code, const char *name)
590{
591 if (nr < 0 || nr >= ARRAY_SIZE(ifsr_info))
592 BUG();
593
594 ifsr_info[nr].fn = fn;
595 ifsr_info[nr].sig = sig;
596 ifsr_info[nr].code = code;
597 ifsr_info[nr].name = name;
598}
599
7ab3f8d5 600asmlinkage void __exception
4fb28474 601do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs)
1da177e4 602{
6fa3eb70
S
603 struct thread_info *thread = current_thread_info();
604 int ret;
d25ef8b8
KS
605 const struct fsr_info *inf = ifsr_info + fsr_fs(ifsr);
606 struct siginfo info;
607
6fa3eb70
S
608 if (!user_mode(regs)) {
609 thread->cpu_excp++;
610 if (thread->cpu_excp == 1) {
611 thread->regs_on_excp = (void *)regs;
612 }
613 /*
614 * NoteXXX: The data abort exception may happen twice
615 * when calling probe_kernel_address() in which.
616 * __copy_from_user_inatomic() is used and the
617 * fixup table lookup may be performed.
618 * Check if the nested panic happens via
619 * (cpu_excp >= 3).
620 */
621 if (thread->cpu_excp >= 3) {
622 aee_stop_nested_panic(regs);
623 }
624 }
625
626 ret = inf->fn(addr, ifsr | FSR_LNX_PF, regs);
627 if (!ret) {
628 if (!user_mode(regs)) {
629 thread->cpu_excp--;
630 }
d25ef8b8 631 return;
6fa3eb70 632 }
d25ef8b8
KS
633
634 printk(KERN_ALERT "Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n",
635 inf->name, ifsr, addr);
636
637 info.si_signo = inf->sig;
638 info.si_errno = 0;
639 info.si_code = inf->code;
640 info.si_addr = (void __user *)addr;
641 arm_notify_die("", regs, &info, ifsr, 0);
1da177e4
LT
642}
643
f7b8156d 644#ifndef CONFIG_ARM_LPAE
993bf4ec
KS
645static int __init exceptions_init(void)
646{
647 if (cpu_architecture() >= CPU_ARCH_ARMv6) {
648 hook_fault_code(4, do_translation_fault, SIGSEGV, SEGV_MAPERR,
649 "I-cache maintenance fault");
650 }
651
b8ab5397
KS
652 if (cpu_architecture() >= CPU_ARCH_ARMv7) {
653 /*
654 * TODO: Access flag faults introduced in ARMv6K.
655 * Runtime check for 'K' extension is needed
656 */
657 hook_fault_code(3, do_bad, SIGSEGV, SEGV_MAPERR,
658 "section access flag fault");
659 hook_fault_code(6, do_bad, SIGSEGV, SEGV_MAPERR,
660 "section access flag fault");
661 }
662
993bf4ec
KS
663 return 0;
664}
665
666arch_initcall(exceptions_init);
f7b8156d 667#endif