Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754154AbdFNDKx (ORCPT ); Tue, 13 Jun 2017 23:10:53 -0400 Received: from ozlabs.ru ([107.173.13.209]:45452 "EHLO ozlabs.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753926AbdFNDKw (ORCPT ); Tue, 13 Jun 2017 23:10:52 -0400 X-Greylist: delayed 559 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Jun 2017 23:10:52 EDT From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , Benjamin Herrenschmidt , Michael Ellerman , Paul Mackerras , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: [PATCH kernel] powerpc/debug: Add missing warn flag to WARN_ON's non-builtin path Date: Wed, 14 Jun 2017 13:01:25 +1000 Message-Id: <20170614030125.45899-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1370 Lines: 41 When trapped on WARN_ON(), report_bug() is expected to return BUG_TRAP_TYPE_WARN so the caller could increment NIP by 4 and continue. The __builtin_constant_p() path of the PPC's WARN_ON() calls (indirectly) __WARN_FLAGS() which has BUGFLAG_WARNING set, however the other branch does not which makes report_bug() report a bug rather than a warning. Fixes: 19d436268dde95389 ("debug: Add _ONCE() logic to report_bug()") Signed-off-by: Alexey Kardashevskiy --- Actually 19d436268dde95389 replaced __WARN_TAINT() with __WARN_FLAGS() and lost BUGFLAG_TAINT() and this is not in the commit log so it is unclear: 1) why 2) whether this particular patch should be doing BUGFLAG_WARNING|BUGFLAG_TAINT(TAINT_WARN) or BUGFLAG_WARNING|(flags) Any ideas? Thanks. --- arch/powerpc/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index f2c562a0a427..0151af6c2a50 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h @@ -104,7 +104,7 @@ "1: "PPC_TLNEI" %4,0\n" \ _EMIT_BUG_ENTRY \ : : "i" (__FILE__), "i" (__LINE__), \ - "i" (BUGFLAG_TAINT(TAINT_WARN)), \ + "i" (BUGFLAG_WARNING|BUGFLAG_TAINT(TAINT_WARN)),\ "i" (sizeof(struct bug_entry)), \ "r" (__ret_warn_on)); \ } \ -- 2.11.0