Commit 41742503 authored by Philippe Gerum's avatar Philippe Gerum Committed by Dmitriy Cherkasov

arm64: ipipe: route all access traps to co-kernel

Notifying the co-kernel about major faults occurring in kernel context
or user-space was overlooked. We need the co-kernel to restore the
root stage whenever applicable before we may attempt to handle the
fault.
parent c2a34cf3
......@@ -401,6 +401,9 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
const struct fault_info *inf;
unsigned long irqflags;
if (__ipipe_report_trap(IPIPE_TRAP_ACCESS, regs))
return;
/*
* If we are in kernel mode at this point, we have no context to
* handle this fault with.
......@@ -473,6 +476,9 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
unsigned long vm_flags = VM_READ | VM_WRITE, irqflags;
unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
if (__ipipe_report_trap(IPIPE_TRAP_ACCESS, regs))
return 0;
irqflags = fault_entry(regs);
if (notify_page_fault(regs, esr))
......
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