Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1581235

Re: [PATCH] arm64: define BUG() instruction without CONFIG_BUG

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] arm64: define BUG() instruction without CONFIG_BUG
Date Wed, 15 Feb 2017 12:40:01 +0100
Message-ID <tb66d-7Lf-9@gated-at.bofh.it> (permalink)
References <taT90-79j-21@gated-at.bofh.it> <tb5Wy-7HU-3@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=pJQ1byq/kKFm/ZYImvD4OVwtv80a38Zk9RBbgcd5cUo=; b=qG7HemagpzD9hiaa6JBuv8ESAL58eUh4ZU6f4cvzeTA70Z25NZfWnMmEWHh7F+U87l D1BHKBnCuJJg+598bjpOZKiYf7iAAwB+n4vLi2pZBZByR1Z4m+lq9W9VI4g3cxBKS1yd 9nwtUQnl9auUBGVqAirfsq/8LW4Yk040Ed8jxLQ4Q9kBqaHN27A/p3+nAg24Mi535ZiC 649Gd5mmt4eUQERXE6/XIWWZoh5UEcf8ADe9k4mCx5uFwBWwPOhfj+/2exHTu9UR9bTI TliqH1f07pY9k+xKn47v9JwP2hPgxmkJq0SGZLfKXqFSV9bytDTU54n4XGS5i9iW3+Z3 yxKA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=pJQ1byq/kKFm/ZYImvD4OVwtv80a38Zk9RBbgcd5cUo=; b=aSq3GcNw8LYBqYX3UkUw6YMNognBO6mREeo+Ld9hQET9kZtEhetruKWe3PLQmyDCoh Ajm3jUfbraiNtOKHTaMbOwkEz7JrBncTOXK7/T8XpXLAgIftnd6Zvx7HIsrfdzwB9Pg9 zBoszXE2KPhbd0YFy/bi4p0sq5K8NXgDk6480dUcyrkPlF3Vmge16bbgmS41M3F6a+Qr klgmO0thyDHIKLPs3FkCc43Q1xNchvqPkb3MUQugHNjZ+vJ7hu0a2qUk7V6p+bKZ4dpx NCWhy3Ri/421pr/ArYXR6JeQ7zuNGjA5WomWWudIuB+bH9Vcp5jToV7yGeLkKv0+iVqT L3yg==
X-Gm-Message-State AMke39ljt0v5jiGTR03e4H4Pv7tKERvOHoo9PzowkAFH5/E66qwADJR2hsfZeAXXgZ6LzNZJt7meK+6JAojRgQ==
X-Received by 10.157.41.40 with SMTP id d37mr20985968otb.253.1487158642445; Wed, 15 Feb 2017 03:37:22 -0800 (PST)
MIME-Version 1.0
X-Google-Sender-Auth dUFXY6zbHf0dp0eUUIHq46sqEHk
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 26
Organization linux.* mail to news gateway
X-Original-Cc Catalin Marinas <catalin.marinas@arm.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux ARM <linux-arm-kernel@lists.infradead.org>, Ard Biesheuvel <ard.biesheuvel@linaro.org>
X-Original-Date Wed, 15 Feb 2017 12:37:22 +0100
X-Original-Message-ID <CAK8P3a0Lo1nZRouK4xYQ3WScg6AvDjWtRRhkx6q7nf3NeXLvxw@mail.gmail.com>
X-Original-References <20170214213941.3026318-1-arnd@arndb.de> <20170215112253.GB9630@arm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1581235

Show key headers only | View raw


On Wed, Feb 15, 2017 at 12:22 PM, Will Deacon <will.deacon@arm.com> wrote:
> On Tue, Feb 14, 2017 at 10:39:28PM +0100, Arnd Bergmann wrote:
>> @@ -57,6 +58,14 @@ _BUGVERBOSE_LOCATION(__FILE__, __LINE__)           \
>>
>>  #define __WARN_TAINT(taint) _BUG_FLAGS(BUGFLAG_TAINT(taint))
>>
>> +#else
>> +
>> +#define BUG() do {                                   \
>> +     asm volatile("brk %[imm]"                       \
>> +                  :: [imm] "i" (BUG_BRK_IMM));       \
>> +     unreachable();                                  \
>> +} while (0)
>
> Do we need to duplicate the asm, or can we reuse the existing BUG
> definition in this header? The only extra thing we do is push a __bug_table
> entry, but I can't see why that would be a problem.

The only reason for turning off CONFIG_BUG is to save a little extra space
in the kernel image, so I think we really don't want the __bug_table to be
generated.

However, we could split the existing asm in two and have only one definition
for the asm containing the brk instruction.

     Arnd

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] arm64: define BUG() instruction without CONFIG_BUG Arnd Bergmann <arnd@arndb.de> - 2017-02-14 22:50 +0100
  Re: [PATCH] arm64: define BUG() instruction without CONFIG_BUG Will Deacon <will.deacon@arm.com> - 2017-02-15 12:30 +0100
    Re: [PATCH] arm64: define BUG() instruction without CONFIG_BUG Arnd Bergmann <arnd@arndb.de> - 2017-02-15 12:40 +0100

csiph-web