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

Arnd Bergmann arnd at arndb.de
Wed Feb 15 03:37:22 PST 2017


On Wed, Feb 15, 2017 at 12:22 PM, Will Deacon <will.deacon at 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



More information about the linux-arm-kernel mailing list