Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp877291oof; Tue, 25 Sep 2018 05:59:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV60zFrydAAwXxbCQ9b4Br3c3IbRKNPVFRM3C+bQhzMxgaq657EvTum/d+TMTj4zTjDVhtTTX X-Received: by 2002:a63:8e43:: with SMTP id k64-v6mr982899pge.75.1537880352046; Tue, 25 Sep 2018 05:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537880352; cv=none; d=google.com; s=arc-20160816; b=CGThOBQLkvuNlYcaJN04kZE0aYNoHDmklFT12AxqLBmVQsoFJ+DBxDG+WedAWHB+L0 cUb/yzBf1YEf4h87suuZZXIDgLP9IwmO1PYs6iOoDh0l8FSy/D/va1C6ZaoGNFpMjp4X fQfGqS9ciAkrmXcMOd9iMsKMwT/8VpNtU2XTCBql7WtM0ssQOOWjHKFeEY6o+KhOS2iE EJAhxBaGSbZyNOWqJp9rOrqT8J5Q+anz7Q/5vJN0IusG1IOlZuTR/DkcD7D0AIGyibUK KGwxtTFgqc1ohhMnYjyseek9y3QIQQ0j3pgfzUuOSPVrZaJBl0HGVqpiOj52Lsf7vN73 kxhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:openpgp:from:references:cc:to; bh=XEChRFDQtz8LNkTCHXhPLHMWBOnQE5uV1FdG+4i7VwE=; b=i/qMFXyJs0XK1I/exI+H358Y+yGnvNSmq345mZZbrLO8sIPVoJ7FpRiw0oFy1dtUBz OwuP5SxG1Qq6+KwBVGEirHo/Ix8adRkVHKWsGV9ZsJPq4L8ZWiXSI0Q9d70wxnvLAeBI abqGMK/zQSYac/x2RV+3YkBaiw2DKHAHgyAtXJuBGfzYNaeBNB7c7R7XkknBD+33cuAu BVHSSizko+um6TRu+FxwE8Jm1f8r+Wj/AaNymk+jy1zi7Lpm9eIHR3kRoHS5NVb3rXEY D5B4jypD6QvTvTQ6j/JBTw+0AhBHR2YYmLZu/7OVcYNLd1rDfAiHOP+Z1fu1XJFpJBw7 EBzw== ARC-Authentication-Results: i=1; mx.google.com; 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 h79-v6si2322500pfa.238.2018.09.25.05.58.56; Tue, 25 Sep 2018 05:59:12 -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; 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 S1729136AbeIYTF4 (ORCPT + 99 others); Tue, 25 Sep 2018 15:05:56 -0400 Received: from mx1.hrz.uni-dortmund.de ([129.217.128.51]:42984 "EHLO unimail.uni-dortmund.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728976AbeIYTF4 (ORCPT ); Tue, 25 Sep 2018 15:05:56 -0400 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 w8PCwQM7023901 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 25 Sep 2018 14:58:26 +0200 (CEST) To: Arnd Bergmann Cc: linux-arch , Linux Kernel Mailing List References: <9516e4b3-f9f2-b150-f019-8b1ef465efb3@tu-dortmund.de> <649d3c5c-3d96-0ed3-cd4d-57641f0ee614@tu-dortmund.de> From: Alexander Lochmann Openpgp: preference=signencrypt Autocrypt: addr=alexander.loch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zjH3pzoYbCp4bhe4cVEv+ibW CrBDBMCV1TedPbDYSYhM0mPavlWJ/SAKx0gTJqYuZel7yNYsDw/R0Tbq7D8SlZX4vJULAu88 bk0AEQEAAcLBZQQYAQIADwUCVAjJQQIbDAUJCWYBgAAKCRBZPu0FvD72/RJJD/9i8hlljqEw BgYc74ComM2q0t1kDWQrhR0nwf114OEkUl9zbMRlWVnS71VYM1qNfrQtUJOsDiFUEksNtMEF 3vG6GfMogfHjOKIX0tJckjvYDpEC2C4o1oNySGME26sitl/C6WwrO3lE1zPTTuqZlbaHNywQ SF0BJV/Iq9AWWdfTgkgqJ05MlR2CuiGxCddT8YyRuWUu2pyOBULdJrs8pGa4ZG5n+SFdw7Sf ylH4UI5yWtgfyqE+xer6UwqMj7WgVB0FxAG9jWmVcBdOll7Kn1+MpXsptyZX8UX2uPgTieBn 9hBXd8GArCG997pWlwS1mvMNwPxXUElvTQTOImJT8UYPuXl5/qGo6ciqjy3rR1kTTDeDUh1U qbviUakZUwztxwp/6XkNDgfyGn9xzdwy2XW47WWONMZdYkfUzIA9n59jJQBct3Uin43ggEGD /XGp9TIHmxO9vTCO0Ibc7lGHR8voiTvxDTZUoBaOQy8EarLBBqlmoNMVj4HJ4lABESE08xyX nr0nmYeU4R8g9e9z8J/rSIUeGyuURcv4J88Kh3JJfB8O6NOpudciOHVFXmrTU5gIja5lt4kJ 73oYy2TmFzl8eKL7Fnb0J9NXVKN4Al3RFkOckCzkERkwnK6tYcwhHf/74svaE7KTa3GSX9aW 6NxCpAsFDwJbauda2prWMzruCg== Subject: Re: [x86] BUG()/BUG_ON() macros cannot be disabled Message-ID: Date: Tue, 25 Sep 2018 14:58:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="i7GBXgWhhOXDNszIRg5BZd7zKotn2cReU" 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) --i7GBXgWhhOXDNszIRg5BZd7zKotn2cReU Content-Type: multipart/mixed; boundary="cJKPIHbMi1BlL6u3FTCAFsNDb9ONDGZSH"; protected-headers="v1" From: Alexander Lochmann To: Arnd Bergmann Cc: linux-arch , Linux Kernel Mailing List Message-ID: Subject: Re: [x86] BUG()/BUG_ON() macros cannot be disabled References: <9516e4b3-f9f2-b150-f019-8b1ef465efb3@tu-dortmund.de> <649d3c5c-3d96-0ed3-cd4d-57641f0ee614@tu-dortmund.de> In-Reply-To: --cJKPIHbMi1BlL6u3FTCAFsNDb9ONDGZSH Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 25.09.2018 um 14:20 schrieb Arnd Bergmann: >=20 > I think it's the most reasonable implementation, otherwise a > function like >=20 > int something(void) > { > if (x) > return 0; > else > BUG(); > } >=20 > will return an uninitialized value. >=20 > The arch specific implementations usually just contain a trapping > instruction. With CONFIG_BUG() you get a nice console output > that indicates where this happened, but without CONFIG_BUG(), > this is just reported as an invalid instruction (if CONFIG_PRINTK > is still enabled), killing the current process. >=20 > Arnd >=20 I see. In that case, you should really update the documentation and help page of CONFIG_BUG. In its current version it is misleading. It can be understood as 'It disables that macro completely.'. Although I know what the purpose of BUG()/BUG_ON() is, I would not consider the above example as valid C code.... Defining BUG as an endless loop to overcome GCC warnings about not returning a value is a dirty hack for me. - 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 --cJKPIHbMi1BlL6u3FTCAFsNDb9ONDGZSH-- --i7GBXgWhhOXDNszIRg5BZd7zKotn2cReU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAluqMPIACgkQWT7tBbw+ 9v2ARBAAln1pTyi+L4yWoHlhEAekRa9SaU6BtKiobke2SvtSEgdbrmqpQLTMPiPi vpOPBg8seQz40tEl1PbcOu0lP0zU8sBemLZN61GreTXrjUzahBLw1Enjsz3wSwR6 rpifHSso1wjNzQaIGV0YhbRCI+94EUZ0ybZvHUtbh9502rHqhc5VP5Pf7xg4iPob x11Aqt5ZXXNeY8m7wmrspSn8Iux1F7+tQsOC+25UVziCn7Jh6lM/XRDIeUfYHmo6 PvZkA72I2LXnmX3+DqTja8jrYDIYfbL0b299MQPVLL/hYcbOYLeejjwudiJ3cv6E v5LRei9K8Q1GK68HpRUk6+emKbkoZKhJdnhqzFHNEW4VvFRE6NufRW7hIHky7LXD JP/TE1u89b8eZxg0nfNJiysliyoNN8O73kKdeiRQuDETkHcT4MJSrkcXy1zljFsR emqcOloWJ6Lc1V+tWrby/7hEDiuV/qbDL2XejncgPdNKSHI+2cIiDmn8waU51uA7 fgmLkdwhYUjTGIJx6dJLEcJti7pxADkn/hXHNAY7qFXCH/nv5v7lDC4AGvNZxdcV ezOHxyrZyHH5/lqJy4zZRwc46UEQOpSj+27M0WOy+8EAEg3aOjbePpuWiFJdXLlp ZTLfnCQCSb6oJ8l481HhMAFImSYOgts3Mofh+tWSs178GN7lils= =wr1i -----END PGP SIGNATURE----- --i7GBXgWhhOXDNszIRg5BZd7zKotn2cReU--