Message ID | 20220927062134.99019-1-wangkefeng.wang@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v3] ARM: mm: Provide better message when kernel fault | expand |
On 2022/9/27 14:21, Kefeng Wang wrote: > If there is a kernel fault, see do_kernel_fault(), we only print > the generic "paging request" or "NULL pointer dereference" message > which don't show read, write or excute information, let's provide > better fault message for them. Hi Russell, what's your option about this one, if no object, I will send to ARM patch system, thanks, > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> > --- > v3: show the infos in die_kernel_fault() > arch/arm/mm/fault.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c > index 46cccd6bf705..f8fe0ec64c23 100644 > --- a/arch/arm/mm/fault.c > +++ b/arch/arm/mm/fault.c > @@ -111,8 +111,9 @@ static void die_kernel_fault(const char *msg, struct mm_struct *mm, > { > bust_spinlocks(1); > pr_alert("8<--- cut here ---\n"); > - pr_alert("Unable to handle kernel %s at virtual address %08lx\n", > - msg, addr); > + pr_alert("Unable to handle kernel %s at virtual address %08lx when %s\n", > + msg, addr, fsr & FSR_LNX_PF ? "execute" : > + fsr & FSR_WRITE ? "write" : "read"); > > show_pte(KERN_ALERT, mm, addr); > die("Oops", regs, fsr);
On Mon, Oct 10, 2022 at 07:24:15PM +0800, Kefeng Wang wrote: > > On 2022/9/27 14:21, Kefeng Wang wrote: > > If there is a kernel fault, see do_kernel_fault(), we only print > > the generic "paging request" or "NULL pointer dereference" message > > which don't show read, write or excute information, let's provide > > better fault message for them. > > Hi Russell, what's your option about this one, if no object, LGTM. > I will send to ARM patch system, thanks, Yes please, if not already done. Thanks.
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 46cccd6bf705..f8fe0ec64c23 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -111,8 +111,9 @@ static void die_kernel_fault(const char *msg, struct mm_struct *mm, { bust_spinlocks(1); pr_alert("8<--- cut here ---\n"); - pr_alert("Unable to handle kernel %s at virtual address %08lx\n", - msg, addr); + pr_alert("Unable to handle kernel %s at virtual address %08lx when %s\n", + msg, addr, fsr & FSR_LNX_PF ? "execute" : + fsr & FSR_WRITE ? "write" : "read"); show_pte(KERN_ALERT, mm, addr); die("Oops", regs, fsr);
If there is a kernel fault, see do_kernel_fault(), we only print the generic "paging request" or "NULL pointer dereference" message which don't show read, write or excute information, let's provide better fault message for them. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- v3: show the infos in die_kernel_fault() arch/arm/mm/fault.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)