From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753922AbcAVNmG (ORCPT ); Fri, 22 Jan 2016 08:42:06 -0500 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:46554 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753891AbcAVNlz (ORCPT ); Fri, 22 Jan 2016 08:41:55 -0500 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: borntraeger@de.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Subject: Re: [PATCH] lib/bug: make panic_on_warn available for all architectures To: Heiko Carstens , Andrew Morton References: <1453468336-60133-1-git-send-email-heiko.carstens@de.ibm.com> Cc: linux-kernel@vger.kernel.org, Prarit Bhargava From: Christian Borntraeger Message-ID: <56A2319B.1050903@de.ibm.com> Date: Fri, 22 Jan 2016 14:41:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1453468336-60133-1-git-send-email-heiko.carstens@de.ibm.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16012213-0009-0000-0000-000007606657 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/22/2016 02:12 PM, Heiko Carstens wrote: > Christian Borntraeger reported that panic_on_warn doesn't have any > effect on s390. > > The panic_on_warn feature was introduced with 9e3961a09798 ("kernel: > add panic_on_warn"). However it did care only for the case when > WANT_WARN_ON_SLOWPATH is defined. This is turn is only the case for > architectures which do not have an own __WARN_TAINT defined. > > Other architectures which do have __WARN_TAINT defined call > report_bug() for warnings within lib/bug.c which does not call panic() > in case panic_on_warn is set. > > Let's simply enable the panic_on_warn feature by adding the same code > like it was added to warn_slowpath_common() in panic.c. > > This enables panic_on_warn also for arm64, parisc, powerpc, s390 and > sh. > > Cc: Prarit Bhargava > Reported-by: Christian Borntraeger > Signed-off-by: Heiko Carstens Tested-by: Christian Borntraeger > --- > lib/bug.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/lib/bug.c b/lib/bug.c > index cff145f032a5..6cde380f09de 100644 > --- a/lib/bug.c > +++ b/lib/bug.c > @@ -175,6 +175,17 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) > pr_warn("WARNING: at %p [verbose debug info unavailable]\n", > (void *)bugaddr); > > + if (panic_on_warn) { > + /* > + * This thread may hit another WARN() in the panic path. > + * Resetting this prevents additional WARN() from > + * panicking the system on this thread. Other threads > + * are blocked by the panic_mutex in panic(). > + */ > + panic_on_warn = 0; > + panic("panic_on_warn set ...\n"); > + } > + > print_modules(); > show_regs(regs); > print_oops_end_marker(); >