summaryrefslogtreecommitdiff
path: root/arch/csky/mm
diff options
context:
space:
mode:
authorGuo Ren <guoren@linux.alibaba.com>2020-07-30 11:09:51 +0000
committerGuo Ren <guoren@linux.alibaba.com>2020-07-31 01:52:22 +0000
commit5bc46ce26cfc42fa066b2206621587f9dea9a8a8 (patch)
treee1f981aac6e5d45f201daa8b0499815dd39c0650 /arch/csky/mm
parent71e193d7cbcfc988c3802e15261bd807171adb6b (diff)
csky: Optimize the trap processing flow
- Seperate different trap functions - Add trap_no() - Remove panic code print - Redesign die_if_kerenl to die with riscv's - Print exact trap info for app segment fault [ 17.389321] gzip[126]: unhandled signal 11 code 0x3 at 0x0007835a in busybox[8000+d4000] [ 17.393882] [ 17.393882] CURRENT PROCESS: [ 17.393882] [ 17.394309] COMM=gzip PID=126 [ 17.394513] TEXT=00008000-000db2e4 DATA=000dcf14-000dd1ad BSS=000dd1ad-000ff000 [ 17.395499] USER-STACK=7f888e50 KERNEL-STACK=bf130300 [ 17.395499] [ 17.396801] PC: 0x0007835a (0x7835a) [ 17.397048] LR: 0x000058b4 (0x58b4) [ 17.397285] SP: 0xbe519f68 [ 17.397555] orig_a0: 0x00002852 [ 17.397886] PSR: 0x00020341 [ 17.398356] a0: 0x00002852 a1: 0x000f2f5a a2: 0x0000d7ae a3: 0x0000005d [ 17.399289] r4: 0x000de150 r5: 0x00000002 r6: 0x00000102 r7: 0x00007efa [ 17.399800] r8: 0x7f888bc4 r9: 0x00000001 r10: 0x000002eb r11: 0x0000aac1 [ 17.400166] r12: 0x00002ef2 r13: 0x00000007 r15: 0x000058b4 [ 17.400531] r16: 0x0000004c r17: 0x00000031 r18: 0x000f5816 r19: 0x000e8068 [ 17.401006] r20: 0x000f5818 r21: 0x000e8068 r22: 0x000f5918 r23: 0x90000000 [ 17.401721] r24: 0x00000031 r25: 0x000000c8 r26: 0x00000000 r27: 0x00000000 [ 17.402199] r28: 0x2ac2a000 r29: 0x00000000 r30: 0x00000000 tls: 0x2aadbaa8 [ 17.402686] hi: 0x00120340 lo: 0x7f888bec /etc/init.ci/ntfs3g_run: line 61: 126 Segmentation fault gzip -c -9 /mnt/test.bin > /mnt/test_bin.gz Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Cc: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/csky/mm')
-rw-r--r--arch/csky/mm/fault.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/csky/mm/fault.c b/arch/csky/mm/fault.c
index 0b9cbf2cf6a9..b1dce9f2f04d 100644
--- a/arch/csky/mm/fault.c
+++ b/arch/csky/mm/fault.c
@@ -183,13 +183,13 @@ bad_area:
bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
if (user_mode(regs)) {
- tsk->thread.trap_no = (regs->sr >> 16) & 0xff;
+ tsk->thread.trap_no = trap_no(regs);
force_sig_fault(SIGSEGV, si_code, (void __user *)address);
return;
}
no_context:
- tsk->thread.trap_no = (regs->sr >> 16) & 0xff;
+ tsk->thread.trap_no = trap_no(regs);
/* Are we prepared to handle this kernel fault? */
if (fixup_exception(regs))
@@ -202,10 +202,10 @@ no_context:
bust_spinlocks(1);
pr_alert("Unable to handle kernel paging request at virtual "
"address 0x%08lx, pc: 0x%08lx\n", address, regs->pc);
- die_if_kernel("Oops", regs, write);
+ die(regs, "Oops");
out_of_memory:
- tsk->thread.trap_no = (regs->sr >> 16) & 0xff;
+ tsk->thread.trap_no = trap_no(regs);
/*
* We ran out of memory, call the OOM killer, and return the userspace
@@ -215,7 +215,7 @@ out_of_memory:
return;
do_sigbus:
- tsk->thread.trap_no = (regs->sr >> 16) & 0xff;
+ tsk->thread.trap_no = trap_no(regs);
mmap_read_unlock(mm);