public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: define BUG() instruction without CONFIG_BUG
Date: Wed, 15 Feb 2017 11:22:53 +0000	[thread overview]
Message-ID: <20170215112253.GB9630@arm.com> (raw)
In-Reply-To: <20170214213941.3026318-1-arnd@arndb.de>

On Tue, Feb 14, 2017 at 10:39:28PM +0100, Arnd Bergmann wrote:
> This mirrors commit e9c38ceba8d9 ("ARM: 8455/1: define __BUG as
> asm(BUG_INSTR) without CONFIG_BUG") to make the behavior of
> arm64 consistent with arm and x86, and avoids lots of warnings in
> randconfig builds, such as:
> 
> kernel/seccomp.c: In function '__seccomp_filter':
> kernel/seccomp.c:666:1: error: no return statement in function returning non-void [-Werror=return-type]
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm64/include/asm/bug.h | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
> index 561190d15881..461751429fc3 100644
> --- a/arch/arm64/include/asm/bug.h
> +++ b/arch/arm64/include/asm/bug.h
> @@ -20,9 +20,10 @@
>  
>  #include <asm/brk-imm.h>
>  
> -#ifdef CONFIG_GENERIC_BUG
>  #define HAVE_ARCH_BUG
>  
> +#ifdef CONFIG_GENERIC_BUG
> +
>  #ifdef CONFIG_DEBUG_BUGVERBOSE
>  #define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
>  #define __BUGVERBOSE_LOCATION(file, line)				\
> @@ -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.

Will

  reply	other threads:[~2017-02-15 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 21:39 [PATCH] arm64: define BUG() instruction without CONFIG_BUG Arnd Bergmann
2017-02-15 11:22 ` Will Deacon [this message]
2017-02-15 11:37   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170215112253.GB9630@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox