]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/arm/mm/abort-ev7.S
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / arch / arm / mm / abort-ev7.S
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
bbe88886
CM
2#include <linux/linkage.h>
3#include <asm/assembler.h>
4/*
5 * Function: v7_early_abort
6 *
da740472
RK
7 * Params : r2 = pt_regs
8 * : r4 = aborted context pc
3e287bec 9 * : r5 = aborted context psr
bbe88886 10 *
da740472 11 * Returns : r4 - r11, r13 preserved
bbe88886
CM
12 *
13 * Purpose : obtain information about current aborted instruction.
14 */
15 .align 5
16ENTRY(v7_early_abort)
bbe88886
CM
17 mrc p15, 0, r1, c5, c0, 0 @ get FSR
18 mrc p15, 0, r0, c6, c0, 0 @ get FAR
2190fed6 19 uaccess_disable ip @ disable userspace access
bbe88886
CM
20
21 /*
22 * V6 code adjusts the returned DFSR.
23 * New designs should not need to patch up faults.
24 */
e220ba60
DE
25
26#if defined(CONFIG_VERIFY_PERMISSION_FAULT)
27 /*
28 * Detect erroneous permission failures and fix
29 */
30 ldr r3, =0x40d @ On permission fault
31 and r3, r1, r3
32 cmp r3, #0x0d
da740472 33 bne do_DataAbort
e220ba60
DE
34
35 mcr p15, 0, r0, c7, c8, 0 @ Retranslate FAR
36 isb
0d147db0
RK
37 mrc p15, 0, ip, c7, c4, 0 @ Read the PAR
38 and r3, ip, #0x7b @ On translation fault
e220ba60 39 cmp r3, #0x0b
da740472 40 bne do_DataAbort
e220ba60 41 bic r1, r1, #0xf @ Fix up FSR FS[5:0]
0d147db0
RK
42 and ip, ip, #0x7e
43 orr r1, r1, ip, LSR #1
e220ba60
DE
44#endif
45
da740472 46 b do_DataAbort
93ed3970 47ENDPROC(v7_early_abort)