diff options
| author | Anshuman Khandual <[email protected]> | 2019-06-07 14:43:05 +0530 |
|---|---|---|
| committer | Catalin Marinas <[email protected]> | 2019-06-07 14:34:24 +0100 |
| commit | c49bd02f4c7412f0182252ae2ef6e916ca4ff359 (patch) | |
| tree | 411037c073b74c9394cc8557d42eaf13e5a65361 | |
| parent | 8e01076afd97521d992e13fb89fb59a6e48fbeec (diff) | |
arm64/mm: Document write abort detection from ESR
This patch adds an is_write_abort() wrapper and documents the detection
of the abort type on cache maintenance operations.
Cc: Will Deacon <[email protected]>
Cc: James Morse <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Signed-off-by: Anshuman Khandual <[email protected]>
[[email protected]: only keep the is_write_abort() wrapper]
Signed-off-by: Catalin Marinas <[email protected]>
| -rw-r--r-- | arch/arm64/mm/fault.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 7c1c8f435f86..765b5eb601ca 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -435,6 +435,15 @@ static bool is_el0_instruction_abort(unsigned int esr) return ESR_ELx_EC(esr) == ESR_ELx_EC_IABT_LOW; } +/* + * Note: not valid for EL1 DC IVAC, but we never use that such that it + * should fault. EL0 cannot issue DC IVAC (undef). + */ +static bool is_write_abort(unsigned int esr) +{ + return (esr & ESR_ELx_WNR) && !(esr & ESR_ELx_CM); +} + static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, struct pt_regs *regs) { @@ -460,7 +469,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, if (is_el0_instruction_abort(esr)) { vm_flags = VM_EXEC; mm_flags |= FAULT_FLAG_INSTRUCTION; - } else if ((esr & ESR_ELx_WNR) && !(esr & ESR_ELx_CM)) { + } else if (is_write_abort(esr)) { vm_flags = VM_WRITE; mm_flags |= FAULT_FLAG_WRITE; } |