arm64: Use arm64_force_sig_info instead of force_sig_info
authorWill Deacon <will.deacon@arm.com>
Tue, 20 Feb 2018 15:18:13 +0000 (15:18 +0000)
committerWill Deacon <will.deacon@arm.com>
Tue, 6 Mar 2018 18:52:32 +0000 (18:52 +0000)
Using arm64_force_sig_info means that printing messages about unhandled
signals is dealt with for us, so use that in preference to force_sig_info
and remove any homebrew printing code.

Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/debug-monitors.c
arch/arm64/kernel/ptrace.c
arch/arm64/kernel/traps.c

index 53781f5687c545c347ce10549d5845219512abe4..06ca574495af9f6c67e841a188b1f6d13f5f1f9d 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/daifflags.h>
 #include <asm/debug-monitors.h>
 #include <asm/system_misc.h>
+#include <asm/traps.h>
 
 /* Determine debug architecture. */
 u8 debug_monitors_arch(void)
@@ -223,7 +224,7 @@ static void send_user_sigtrap(int si_code)
        if (interrupts_enabled(regs))
                local_irq_enable();
 
-       force_sig_info(SIGTRAP, &info, current);
+       arm64_force_sig_info(&info, "User debug trap", current);
 }
 
 static int single_step_handler(unsigned long addr, unsigned int esr,
index 9ae31f7e224365d054a9712551b9ac75a0b19e9e..6228476e74ba3c970df0333b0ae6ededb974afb5 100644 (file)
@@ -209,7 +209,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
                force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger);
        }
 #endif
-       force_sig_info(SIGTRAP, &info, current);
+       arm64_force_sig_info(&info, "Hardware breakpoint trap (ptrace)", current);
 }
 
 /*
index b139fe2d21260491d6ba310ae07746f4c2cb1e4b..2b478565d774935959f4af06f14d7a112c4110aa 100644 (file)
@@ -633,11 +633,6 @@ asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
 {
        siginfo_t info;
        void __user *pc = (void __user *)instruction_pointer(regs);
-       console_verbose();
-
-       pr_crit("Bad EL0 synchronous exception detected on CPU%d, code 0x%08x -- %s\n",
-               smp_processor_id(), esr, esr_get_class_string(esr));
-       __show_regs(regs);
 
        info.si_signo = SIGILL;
        info.si_errno = 0;
@@ -645,9 +640,9 @@ asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
        info.si_addr  = pc;
 
        current->thread.fault_address = 0;
-       current->thread.fault_code = 0;
+       current->thread.fault_code = esr;
 
-       force_sig_info(info.si_signo, &info, current);
+       arm64_force_sig_info(&info, "Bad EL0 synchronous exception", current);
 }
 
 #ifdef CONFIG_VMAP_STACK