Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp947830imm; Wed, 25 Jul 2018 08:50:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfnWwR25HPEGZcf/NftGxwSClw0f1UL17fCQ6D9QdWx9tX7P4Dc5ar5VcflIY2CzFQrIOhn X-Received: by 2002:a17:902:b205:: with SMTP id t5-v6mr21209984plr.220.1532533851220; Wed, 25 Jul 2018 08:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532533851; cv=none; d=google.com; s=arc-20160816; b=XoGa9xdxiqeHsRVa/KalliNhXYHVV1sIx7j3zZFx2+i3AYO8FHVu3Y3E6FcyyhTbAP fWNnGI8YVaircU5gwBrQnTJ9qFALzAq59wjggBPQbuXuVzsDIIIPvHfwdyo58SxLiTve nejmY5svTdq6h8XH47/PbygBP1CmSDYSfyzV89dxm5/i9ZCTHbHirD/CYSnZUNWHrKgX 7PC0f9BHz2TeHM6Nu0NqdGvkMfE81YLAK2IBC7dmz4buLm18uKEBvQIUn+Bxcmp7ctR0 hn88+4osQz/VB6o/6Al78CU7JJfwQ9xQ0QNGkojFkPCS1SeGoDJf7SnRngulP5MV+H5K ZF0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-disposition:mime-version:user-agent:in-reply-to:references :subject:cc:to:from:message-id:date:arc-authentication-results; bh=DVUSI6ar/LZJhUdJT66i6gCtPcw2fanE7fnli+2kFe4=; b=eSspo6ffahsPsIXDsqPFwOb7l1xMHBRB7iF3KdgebDpZTRL6CrpelEgHYR15sl2H+q Kh9KJglTCB0utn6KS0CFsLHsNG9pg4MC2eKKhm+KruBv4knxcKVgYfktYh29E30oCeVB tsAftXjQvEw79ji6ZdT6LEoc+4ZzjhYh/swawrmXBs5OFZM90jBXW3wfLVJwa9EWdWWb 4iR6qRGeLm3NB/EApTtUeeuxFpSv2N4ev6UbUJzv0CFkWdiFZx1UsYnv8ujnuvEykM7a 3AacBRzEXDGWi3yNSg/dQ6JvqiG3dM2v7VmODN5ZRTI0JaMQ8kzF7JxqZ7r+u+mFz3+b gicg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1-v6si12257078plo.176.2018.07.25.08.50.36; Wed, 25 Jul 2018 08:50:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729184AbeGYRBp convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Jul 2018 13:01:45 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:32278 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728568AbeGYRBp (ORCPT ); Wed, 25 Jul 2018 13:01:45 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 41bKRD5PCMz9ty7H; Wed, 25 Jul 2018 17:49:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id kISTIzbL2iAP; Wed, 25 Jul 2018 17:49:28 +0200 (CEST) Received: from vm-hermes.si.c-s.fr (vm-hermes.si.c-s.fr [192.168.25.253]) by pegase1.c-s.fr (Postfix) with ESMTP id 41bKRD4khlz9ty76; Wed, 25 Jul 2018 17:49:28 +0200 (CEST) Received: by vm-hermes.si.c-s.fr (Postfix, from userid 33) id 968508A8; Wed, 25 Jul 2018 17:49:27 +0200 (CEST) Received: from 37.173.118.119 ([37.173.118.119]) by messagerie.si.c-s.fr (Horde Framework) with HTTP; Wed, 25 Jul 2018 17:49:27 +0200 Date: Wed, 25 Jul 2018 17:49:27 +0200 Message-ID: <20180725174927.Horde.Sfg4oyTmcaLgHIJr3Gf-oQ1@messagerie.si.c-s.fr> From: LEROY Christophe To: Murilo Opsfelder Araujo Cc: linuxppc-dev@lists.ozlabs.org, "Tobin C . Harding" , Sukadev Bhattiprolu , Simon Guo , Paul Mackerras , Nicholas Piggin , Michael Neuling , Michael Ellerman , "Eric W . Biederman" , Cyril Bur , Benjamin Herrenschmidt , Balbir Singh , Andrew Donnellan , Alastair D'Silva , linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] powerpc/traps: Print signal name for unhandled signals References: <20180724192720.32417-1-muriloo@linux.ibm.com> <20180724192720.32417-7-muriloo@linux.ibm.com> In-Reply-To: <20180724192720.32417-7-muriloo@linux.ibm.com> User-Agent: Internet Messaging Program (IMP) H5 (6.2.3) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Murilo Opsfelder Araujo a écrit : > This adds a human-readable name in the unhandled signal message. > > Before this patch, a page fault looked like: > > Jul 11 16:04:11 localhost kernel: pandafault[6303]: unhandled > signal 11 at 00000000100007d0 nip 000000001000061c lr > 00007fff93c55100 code 2 in pandafault[10000000+10000] > > After this patch, a page fault looks like: > > Jul 11 18:14:48 localhost kernel: pandafault[6352]: segfault > (11) at 000000013a2a09f8 nip 000000013a2a086c lr 00007fffb63e5100 > code 2 in pandafault[13a2a0000+10000] > > Signed-off-by: Murilo Opsfelder Araujo > --- > arch/powerpc/kernel/traps.c | 43 +++++++++++++++++++++++++++++++++---- > 1 file changed, 39 insertions(+), 4 deletions(-) > > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c > index e6c43ef9fb50..e55ee639d010 100644 > --- a/arch/powerpc/kernel/traps.c > +++ b/arch/powerpc/kernel/traps.c > @@ -96,6 +96,41 @@ EXPORT_SYMBOL(__debugger_fault_handler); > #define TM_DEBUG(x...) do { } while(0) > #endif > > +static const char *signames[SIGRTMIN + 1] = { > + "UNKNOWN", > + "SIGHUP", // 1 > + "SIGINT", // 2 > + "SIGQUIT", // 3 > + "SIGILL", // 4 > + "unhandled trap", // 5 = SIGTRAP > + "SIGABRT", // 6 = SIGIOT > + "bus error", // 7 = SIGBUS > + "floating point exception", // 8 = SIGFPE > + "illegal instruction", // 9 = SIGILL > + "SIGUSR1", // 10 > + "segfault", // 11 = SIGSEGV > + "SIGUSR2", // 12 > + "SIGPIPE", // 13 > + "SIGALRM", // 14 > + "SIGTERM", // 15 > + "SIGSTKFLT", // 16 > + "SIGCHLD", // 17 > + "SIGCONT", // 18 > + "SIGSTOP", // 19 > + "SIGTSTP", // 20 > + "SIGTTIN", // 21 > + "SIGTTOU", // 22 > + "SIGURG", // 23 > + "SIGXCPU", // 24 > + "SIGXFSZ", // 25 > + "SIGVTALRM", // 26 > + "SIGPROF", // 27 > + "SIGWINCH", // 28 > + "SIGIO", // 29 = SIGPOLL = SIGLOST > + "SIGPWR", // 30 > + "SIGSYS", // 31 = SIGUNUSED > +}; > + > /* > * Trap & Exception support > */ > @@ -314,10 +349,10 @@ static void show_signal_msg(int signr, struct > pt_regs *regs, int code, > if (!unhandled_signal(current, signr)) > return; > > - pr_info("%s[%d]: unhandled signal %d at "REG_FMT \ > - " nip "REG_FMT" lr "REG_FMT" code %x", > - current->comm, current->pid, signr, addr, > - regs->nip, regs->link, code); > + pr_info("%s[%d]: %s (%d) at "REG_FMT" nip "REG_FMT \ > + " lr "REG_FMT" code %x", > + current->comm, current->pid, signames[signr], > + signr, addr, regs->nip, regs->link, code); Are we sure that signr is always within the limits of the table ? Christophe > > print_vma_addr(KERN_CONT " in ", regs->nip); > > -- > 2.17.1