Re: [PATCH 2/6] x86: bug: prevent gcc distortions

From: Nadav Amit
Date: Fri May 18 2018 - 12:28:24 EST


Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, May 18, 2018 at 12:59 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> wrote:
>
>> This is an awesome hack, but is there really nothing we can do to make
>> it more readable? Esp, that global asm doing the macro definition is a
>> pain to read.
>
> I actually find that macro to be *more* legible than what we do now,
> although I'm not enamored with the pseudo-operation name ("__BUG_FLAGS").
>
> That said, the C header code itself I don't love.
>
> I wonder if we should just introduce a new assembler header file, and get
> it included when processing compiler-generated asm. We already do that for
> our _real_ *.S files, with a number of our header files having constants
> and code for the asm case too, not just C.
>
> But we could have an <asm/asm-macro.h> header file that has these kinds of
> macros (or "pseudo-instructions") for assembly language cases, and then we
> could just rely on them in inline asm.

Will it be ok just to use a global inline asm to set an â.includeâ directive
that gas would later process? (I can probably wrap it in a C macro so it
wonât be too disgusting)