Re: [PATCH] arm64: panic on synchronous external abort in kernel context
From: James Morse
Date: Tue Apr 14 2020 - 08:16:29 EST
Hi Xie,
On 14/04/2020 11:59, Mark Rutland wrote:
> On Fri, Apr 10, 2020 at 09:52:45AM +0800, Xie XiuQi wrote:
>> We should panic even panic_on_oops is not set, when we can't recover
>> from synchronous external abort in kernel context.
Hmm, fault-from-kernel-context doesn't mean the fault affects the kernel. If the kernel is
reading or writing from user-space memory for a syscall, its the user-space memory that is
affected. This thread can't make progress, so we kill it.
If its a kernel thread or we were in irq context, we panic().
I don't think you really want all faults that happen as a result of a kernel access to be
fatal!
[...]
> What exactly are you trying to catch here? If you are seeing a problem
> in practice, can you please share your log from a crash?
Yes please!
I suspect you want to make memory_failure() smarter about faults that affect the kernel
text or data. If so, please do it in memory_failure() where it benefits all architectures,
and all methods of reporting errors.
(we may need a 'synchronous' hint to memory_failure(), it expects everything to be
asynchronous).
If its not memory, we should extend the RAS handling to know what this error is, and that
it is fatal. (e.g. PE state is infected)
Thanks,
James