Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp756608ybl; Fri, 23 Aug 2019 07:57:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0sazPnBB3lSojkOgePKFK5KuLGAWYBPg61VpG3cTwMDiaEMkHoybBPOzA+kpsrahbcrmD X-Received: by 2002:a17:902:b406:: with SMTP id x6mr5127013plr.114.1566572253184; Fri, 23 Aug 2019 07:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566572253; cv=none; d=google.com; s=arc-20160816; b=hsq4G2l582Kj+H2or+qp8iXiVECQcT2Ex/YfQu8lABF+UTQIC6zTTm5AnQknOwc1fe CSBzmTzHEjk8GiyxezSGZhsFYMd/Yy5er+hWOQLex5WABrvjAyXi2u5IMhN9E50fQAIo qd+hIEP6bjGGVy01JImx4qyDuQiyOS0o6j3pLdynfOLugPDoB7bVBrl4WVyI9v7TkXf2 OPIu8em8jbFxo+mu3DQcXWQ6dI7FsBpzFOnBrxqDZ3UdFmygLAOmA0/JTDTJY8MwizT4 k0q19q9f2zr27oibTZCvWuLKoKuB5khaWQUeBJFX+Dfy0h+csGp1Ue0rbhvPV5Dc63i6 5wBQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=dOMvKkxdztvagslTilMXvbS0slW7HhIVv9oDXR5pGrQ=; b=1LdSPjN4+fa4FrAH6q91zNfUxYrzI0paqJHvmja+qD/B2HaOF1sNN8ObvYvbfB5Dpb frsEuDimjU2woq6Hzok2Y8n2FDGgdgIKt/eiyAAlQPiVXQ67TstXBx9fKKTRumaJ14Td cBlpSrlXtXqOJ0mB7+FJUmTgs/6jK5uVb9FtI6RIcIV1G6qfCb2ltvzrgmY6i8m8msEU 6JnWqh8e+GtxuKZHA49XiOA2Fxs4P4PpsN+Pt2+I8Cb3zpBl17fhJuBBk/1XDaZZuKzO apbt/nONEhDi3E8XBlGQmIegOKyz7/Gp0V9GUEbTmNjSVhTO0W4InI+k5BB8T/U73qe7 Pjiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uXnOkuDB; 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 o37si2551022pjb.94.2019.08.23.07.57.17; Fri, 23 Aug 2019 07:57:33 -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; dkim=pass header.i=@kernel.org header.s=default header.b=uXnOkuDB; 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 S2405353AbfHVW4N (ORCPT + 99 others); Thu, 22 Aug 2019 18:56:13 -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