aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/troubleshoot.c
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2017-12-20 12:37:54 -0800
committerVineet Gupta <vgupta@synopsys.com>2017-12-20 15:16:18 -0800
commitf5a16b93e6291ba1f65f55647cb4cd8d75ed1b35 (patch)
tree4c6243cc717af027d95dff55542b05b067ef16a8 /arch/arc/kernel/troubleshoot.c
parentARC: uaccess: dont use "l" gcc inline asm constraint modifier (diff)
downloadlinux-dev-f5a16b93e6291ba1f65f55647cb4cd8d75ed1b35.tar.xz
linux-dev-f5a16b93e6291ba1f65f55647cb4cd8d75ed1b35.zip
ARC: handle gcc generated __builtin_trap()
gcc toggle -fisolate-erroneous-paths-dereference (default at -O2 onwards) isolates faulty code paths such as null pointer access, divide by zero etc by emitting __builtin_trap() Newer ARC gcc generates TRAP_S 5 instruction which needs to be handled and treated like any other unexpected exception - user mode : task terminated with a SEGV - kernel mode: die() called after register and stack dump Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel/troubleshoot.c')
-rw-r--r--arch/arc/kernel/troubleshoot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c
index 7d8c1d6c2f60..6e9a0a9a6a04 100644
--- a/arch/arc/kernel/troubleshoot.c
+++ b/arch/arc/kernel/troubleshoot.c
@@ -163,6 +163,9 @@ static void show_ecr_verbose(struct pt_regs *regs)
else
pr_cont("Bus Error, check PRM\n");
#endif
+ } else if (vec == ECR_V_TRAP) {
+ if (regs->ecr_param == 5)
+ pr_cont("gcc generated __builtin_trap\n");
} else {
pr_cont("Check Programmer's Manual\n");
}