Commit c49bd02f authored by Anshuman Khandual's avatar Anshuman Khandual Committed by Catalin Marinas

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 <will.deacon@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
[catalin.marinas@arm.com: only keep the is_write_abort() wrapper]
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 8e01076a
...@@ -435,6 +435,15 @@ static bool is_el0_instruction_abort(unsigned int esr) ...@@ -435,6 +435,15 @@ static bool is_el0_instruction_abort(unsigned int esr)
return ESR_ELx_EC(esr) == ESR_ELx_EC_IABT_LOW; 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, static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
struct pt_regs *regs) struct pt_regs *regs)
{ {
...@@ -460,7 +469,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, ...@@ -460,7 +469,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
if (is_el0_instruction_abort(esr)) { if (is_el0_instruction_abort(esr)) {
vm_flags = VM_EXEC; vm_flags = VM_EXEC;
mm_flags |= FAULT_FLAG_INSTRUCTION; 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; vm_flags = VM_WRITE;
mm_flags |= FAULT_FLAG_WRITE; mm_flags |= FAULT_FLAG_WRITE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment