From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5065DC3A5A1 for ; Thu, 22 Aug 2019 22:56:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04A3723401 for ; Thu, 22 Aug 2019 22:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566514575; bh=CENPwtb2FY1x/UJEAS1RnlydKDfarsP46dEap4EfKK8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=RfENvb+iQwmTpoNJJG1j6ZN77nnOwQQ+Eia6OTprAcOYYnCXPmyokLGUDhMLdIIwf Gv3DLLRRW6FlHA1AnfWTz9StRPb4L9cklv9+zKALhVddAt5PWw7bgP+llTzFl5PG9S MsyK3+iZTSYdca3Vpg5IXx8awwwZYI5PA3tlXM6I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405357AbfHVW4O (ORCPT ); Thu, 22 Aug 2019 18:56:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:36540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390930AbfHVW4N (ORCPT ); Thu, 22 Aug 2019 18:56:13 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1273921848; Thu, 22 Aug 2019 22:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566514572; bh=CENPwtb2FY1x/UJEAS1RnlydKDfarsP46dEap4EfKK8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uXnOkuDBPN0Vpc9K0gTry3P7952XuXMFABVO0/8pqvs6iaSTt7mTjlxNTZuRDw2Nj LbKY5hJtrADuRv5FnmwmFbtf2hQg+9kGYONiHe/ZN3eX6llljPu9zs+PyDpf40xLHq 4bOQRinE0EOA7OammwpLPInlQ+PqQCBetTfk6bjM= Date: Thu, 22 Aug 2019 15:56:11 -0700 From: Andrew Morton To: 20190819234111.9019-8-keescook@chromium.org Cc: Kees Cook , Christophe Leroy , Peter Zijlstra , Drew Davenport , Arnd Bergmann , "Steven Rostedt (VMware)" , Feng Tang , Petr Mladek , Mauro Carvalho Chehab , Borislav Petkov , YueHaibing , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 7/7] bug: Move WARN_ON() "cut here" into exception handler Message-Id: <20190822155611.a1a6e26db99ba0876ba9c8bd@linux-foundation.org> In-Reply-To: <201908200943.601DD59DCE@keescook> References: <201908200943.601DD59DCE@keescook> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Aug 2019 09:47:55 -0700 Kees Cook wrote: > Reply-To: 20190819234111.9019-8-keescook@chromium.org Really? > Subject: [PATCH v2 7/7] bug: Move WARN_ON() "cut here" into exception handler It's strange to receive a standalone [7/7] patch. > Date: Tue, 20 Aug 2019 09:47:55 -0700 > Sender: linux-kernel-owner@vger.kernel.org > > The original clean up of "cut here" missed the WARN_ON() case (that > does not have a printk message), which was fixed recently by adding > an explicit printk of "cut here". This had the downside of adding a > printk() to every WARN_ON() caller, which reduces the utility of using > an instruction exception to streamline the resulting code. By making > this a new BUGFLAG, all of these can be removed and "cut here" can be > handled by the exception handler. > > This was very pronounced on PowerPC, but the effect can be seen on > x86 as well. The resulting text size of a defconfig build shows some > small savings from this patch: > > text data bss dec hex filename > 19691167 5134320 1646664 26472151 193eed7 vmlinux.before > 19676362 5134260 1663048 26473670 193f4c6 vmlinux.after > > This change also opens the door for creating something like BUG_MSG(), > where a custom printk() before issuing BUG(), without confusing the "cut > here" line. I can't get this to apply to anything, so I guess that [1/7]-[6/7] mattered ;) > Reported-by: Christophe Leroy > Fixes: Fixes: 6b15f678fb7d ("include/asm-generic/bug.h: fix "cut here" for WARN_ON for __WARN_TAINT architectures") I'm seeing double. > Signed-off-by: Kees Cook