Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp803431oof; Tue, 25 Sep 2018 05:01:16 -0700 (PDT) X-Received: by 2002:a17:902:74c7:: with SMTP id f7-v6mr814384plt.45.1537876636239; Tue, 25 Sep 2018 04:57:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV62G2bMsOUnqD2R6GdwAKW97cF918Z34MlnuE3cq4+jBUl0m62R6dx51tHkf3626od//cgL3 X-Received: by 2002:a17:902:74c7:: with SMTP id f7-v6mr814316plt.45.1537876635562; Tue, 25 Sep 2018 04:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537876635; cv=none; d=google.com; s=arc-20160816; b=Ls1rZ93rUeQ4ac+AyidAXvlzr982OUAUGcQC9Y+rgPCEDQdmowkGNqndpyDFOsC/sd sUiykVrm4fJjMJtHvzH7Q06kGm/wrcKOfPOiTJHj8dDomREOAxfVX/UuNY6Ste/acFVy fCbx/q/2FsWeQemjL0D06ldNJwlhB9TZgUVgSqsq4Ff50HDAAAEKcdX558LLboePaSfo z4/lXC+r6EvLNvnt1/MpusXfxUmCUgObAZ47feke5q43L0NppcWAMhG2AYD5g+eCzqXq 6HR62lAD1RpxNfeSt8+P3KDZhaHTqFXT9RM447Nwn9SHs7NnwIRKCoNwTHYBcrylBaNW AfFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:date:message-id :subject:autocrypt:openpgp:from:cc:to:dkim-signature; bh=xa+7//ZbFVX0DtDH9s/w1vdht8c9CEd2Ght4lMelwlY=; b=xCitUL0l4lP4yi2eLLOvXvlo9wa6ym/+ScfpIN+5f2kVVhSGpqRfdUjNMVsPuPrEE3 LRx18lgM22DPLXx0CClvDdxjLEedrxvMwxyb/k/wdwksJzoqUCgMx01zEKdd0xg5l2TY 184+GMNpCDEcCsb6YQbslpxId7U2hKzhiv1OKX//YDM/TKsWgjjQERKuqexeqViWU/M6 cN8sYaj9TVw7XmECQiDtZ4ZIVa5e4Lx3+DjJwXs3ZAk7hYYQcw5fjI+lMIGfZv0l6eOB 8BXwHjbPQ2iB8NzEobo6qmMRypzrdJaRWIHMc8Jr1wqREn/bz3aI7JIr4cLX8QDTKUu8 dz2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tu-dortmund.de header.s=unimail header.b=kp+PSyHk; 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 f23-v6si2240080plr.470.2018.09.25.04.56.59; Tue, 25 Sep 2018 04:57:15 -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=@tu-dortmund.de header.s=unimail header.b=kp+PSyHk; 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 S1728655AbeIYSD5 (ORCPT + 99 others); Tue, 25 Sep 2018 14:03:57 -0400 Received: from mx1.hrz.uni-dortmund.de ([129.217.128.51]:54204 "EHLO unimail.uni-dortmund.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727165AbeIYSD4 (ORCPT ); Tue, 25 Sep 2018 14:03:56 -0400 X-Greylist: delayed 1276 seconds by postgrey-1.27 at vger.kernel.org; Tue, 25 Sep 2018 14:03:54 EDT Received: from [129.217.43.49] (limnos.cs.uni-dortmund.de [129.217.43.49]) (authenticated bits=0) by unimail.uni-dortmund.de (8.16.0.29/8.16.0.29) with ESMTPSA id w8PBZTCW014506 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 25 Sep 2018 13:35:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1537875330; bh=5gckrvGmOSp1fmzymczdnp/pKK8sewgPd7jlDPowcUw=; h=To:Cc:From:Subject:Date; b=kp+PSyHk5So8QKP+RJgLvt4Vj1da+xaZMEwCVgnWe1uUUnf37j5/Wm2pu3RCscIAr HsmzyjV6Nl1p7fKTADOmRK0G18xB2eP0jvTufL4hMTUB12QiG45goVgYpCJo7OOm88 +KfS6Tz2lWB5QtEe4TShyt5AYfhI4CtfNVx6lGHk= To: arnd@arndb.de Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org From: Alexander Lochmann Openpgp: preference=signencrypt Autocrypt: addr=alexander.lochmann@tu-dortmund.de; prefer-encrypt=mutual; keydata= xsFNBFQIyUEBEADZ+x+Ssg/46SiU66zm2lPGYAdqYfmXVv+sf/23+/KSj0FQHZKywzWjsmgR vWZZVlGJolwcW3MJ/g6ctZeOpfYiZVpzbZwNgKU0ETGjUmqmlq5/o5KnENKOimZzaKSaNn9p IC+EIeWXvu7pQjW0w1bK/RVVNw0p1Iz82W4Z+vKtD8CS+YJLAcZ6YoZMvQEg84O9odlV2Ryp oVj9EzHH40TWEdtgd4pQkaOks01PEr19sJXUjnP0VxLfs91AZjRnmGJKnI4HcrOKwquoQEeL DtHCxK0VNeoXCWkz33uBxSL5cicQ7D09hxjWthMilUpDZT94x0K452q4nybQ1TSLTYC8mlW+ xKUvJmqfHZbITJ10dTgjNvOe0kLbpXeQ1789lNmnA9bkQAK5Cefo55WbXmr1Mo3PV7y0XCib OaiijPlZo/Isc03EOK3lHPK8NuY8G+ftvphO4RyXCUWXw/o01cDnPaIEcTWkUbXvMhf/6ltP 1QWEfkguzGVjTw7Xssm9YuokC+P+49JKRyZzyCJZ022OxMlsX6c1BNZ4+cWUNmn6xr1xRNse SglpMLL1m3K1KuLf1hdAor6PBzFLiLa33lUhsWt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BBqlmoNMVj4HJ4lABESE08xyX nr0nmYeU4R8g9e9z8J/rSIUeGyuURcv4J88Kh3JJfB8O6NOpudciOHVFXmrTU5gIja5lt4kJ 73oYy2TmFzl8eKL7Fnb0J9NXVKN4Al3RFkOckCzkERkwnK6tYcwhHf/74svaE7KTa3GSX9aW 6NxCpAsFDwJbauda2prWMzruCg== Subject: [x86] BUG()/BUG_ON() macros cannot be disabled Message-ID: <9516e4b3-f9f2-b150-f019-8b1ef465efb3@tu-dortmund.de> Date: Tue, 25 Sep 2018 13:35:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="beyh2CM9IKZjJUog9ZIi56j5rFrMc4SBz" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --beyh2CM9IKZjJUog9ZIi56j5rFrMc4SBz Content-Type: multipart/mixed; boundary="ykzM58qJSbQVMj6jyweAtzezWrFi9csp4"; protected-headers="v1" From: Alexander Lochmann To: arnd@arndb.de Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <9516e4b3-f9f2-b150-f019-8b1ef465efb3@tu-dortmund.de> Subject: [x86] BUG()/BUG_ON() macros cannot be disabled --ykzM58qJSbQVMj6jyweAtzezWrFi9csp4 Content-Type: multipart/mixed; boundary="------------5E0CA33CC47A8D6B0687C66A" Content-Language: en-US This is a multi-part message in MIME format. --------------5E0CA33CC47A8D6B0687C66A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Arnd, I recently tried to disable the BUG macros on x86-32. I disabled the config item in 'General Setup -> Configure standard kernel features (expert users) -> BUG() support'. However, BUG/BUG_ON is still defined. In the !CONFIG_BUG branch in include/asm-generic/bug.h (line 181) the code checks for the existence of architecture-specific variants of those macros. Since x86 defines its own version of BUG(), line 182 is *not* used. In the following, the x86 variant of BUG() is then used to define the BUG_ON() macro. I propose a patch that really disables both macros if the developer wants it. It undefines the respective x86 variants, and defines both macros as 'empty' macros. Regards, Alex --=20 Technische Universit=C3=A4t Dortmund Alexander Lochmann PGP key: 0xBC3EF6FD Otto-Hahn-Str. 16 phone: +49.231.7556141 D-44227 Dortmund fax: +49.231.7556116 http://ess.cs.tu-dortmund.de/Staff/al --------------5E0CA33CC47A8D6B0687C66A Content-Type: text/x-patch; name="disable-bug-macro.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="disable-bug-macro.patch" diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 20561a60db9c..1e7977582277 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -178,14 +178,17 @@ void __warn(const char *file, int line, void *calle= r, unsigned taint, }) =20 #else /* !CONFIG_BUG */ -#ifndef HAVE_ARCH_BUG -#define BUG() do {} while (1) +#ifdef HAVE_ARCH_BUG +#undef BUG #endif =20 -#ifndef HAVE_ARCH_BUG_ON -#define BUG_ON(condition) do { if (condition) BUG(); } while (0) +#ifdef HAVE_ARCH_BUG_ON +#undef BUG_ON #endif =20 +#define BUG_ON(condition) do { if (condition) BUG(); } while (0) +#define BUG() do {} while (1) + #ifndef HAVE_ARCH_WARN_ON #define WARN_ON(condition) ({ \ int __ret_warn_on =3D !!(condition); \ --------------5E0CA33CC47A8D6B0687C66A-- --ykzM58qJSbQVMj6jyweAtzezWrFi9csp4-- --beyh2CM9IKZjJUog9ZIi56j5rFrMc4SBz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAluqHYEACgkQWT7tBbw+ 9v0zChAAliYhce/UyYMlH6hVIcK8eoehFisYKEz8wK5Rd8VGWxsXMTvVVeWaj/j2 q+Gu+ixJvdZHqlgOYDvce6arXBDKQXS4Yzf975gXAlk170+UVREBrREpihaKOsFk 1bvAZ9cUTLI1Btc/VyNS98Pd83XOBzyas7PNDsppKlPG/Z4fJAWRWHr9C8nJm+Vt lSBL6I7E2ytbBHNQLLMSeo/W5z3VMfvAHEMdaGp9PG0A90UQEAu1OyR8OgwzjJYd XRxuYSXUk/C5oT8syuIEOoUdpW7HPoTNeRQBzwcThgsj39N+f1hgPrw2SB3iqdr+ iy9vMAJfsQvImk1OQ7vYk7+HO0sDhjccF71M/G8tSN6m0kzWm7bsya+xk5dA659C Mldev/vYT84tLR1GMjaMbNb1YubNIDPXHhUgVfojT589e0FswuEvBpdt+mUCrJ1i 68dnpEm2NStc94oq/jya8pw3MNQofJc9MkDoiDMZZW1jcKx1R4XPZDrj/IKTsTiw Z+lXNkrk/w97beu7h8vBB9VcGSxZQaNaWoDMvg92m5R9Ad/GeVBGnwHTQ5YoDQUQ l3SpJUFXsJ1Ii6nhAxRW1OCoHNEXzuh9fBJZ2vd0vBOGAD/3Cs3kQDOf7SctF28/ VdcjlS9v6vs0i5PpF1DAtAdqX2YRRrLGvI4tF2vT8u7RxcF0U9A= =2Kut -----END PGP SIGNATURE----- --beyh2CM9IKZjJUog9ZIi56j5rFrMc4SBz--