diff options
author | Guo Ren <guoren@linux.alibaba.com> | 2020-07-30 11:09:51 +0000 |
---|---|---|
committer | Guo Ren <guoren@linux.alibaba.com> | 2020-07-31 01:52:22 +0000 |
commit | 5bc46ce26cfc42fa066b2206621587f9dea9a8a8 (patch) | |
tree | e1f981aac6e5d45f201daa8b0499815dd39c0650 /arch/csky/include/asm | |
parent | 71e193d7cbcfc988c3802e15261bd807171adb6b (diff) | |
download | lwn-5bc46ce26cfc42fa066b2206621587f9dea9a8a8.tar.gz lwn-5bc46ce26cfc42fa066b2206621587f9dea9a8a8.zip |
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/include/asm')
-rw-r--r-- | arch/csky/include/asm/bug.h | 3 | ||||
-rw-r--r-- | arch/csky/include/asm/ptrace.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/arch/csky/include/asm/bug.h b/arch/csky/include/asm/bug.h index bd7b3235bb84..33ebd16b9c78 100644 --- a/arch/csky/include/asm/bug.h +++ b/arch/csky/include/asm/bug.h @@ -20,7 +20,8 @@ do { \ struct pt_regs; -void die_if_kernel(char *str, struct pt_regs *regs, int nr); +void die(struct pt_regs *regs, const char *str); void show_regs(struct pt_regs *regs); +void show_code(struct pt_regs *regs); #endif /* __ASM_CSKY_BUG_H */ diff --git a/arch/csky/include/asm/ptrace.h b/arch/csky/include/asm/ptrace.h index 82da5e08558d..91ceb1b454c9 100644 --- a/arch/csky/include/asm/ptrace.h +++ b/arch/csky/include/asm/ptrace.h @@ -24,6 +24,7 @@ #define user_mode(regs) (!((regs)->sr & PS_S)) #define instruction_pointer(regs) ((regs)->pc) #define profile_pc(regs) instruction_pointer(regs) +#define trap_no(regs) ((regs->sr >> 16) & 0xff) static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val) |