Re: [PATCH 0/8] objtool, x86/alternative: Convert objtool annotations and x86 alternatives to assembler macros

From: Josh Poimboeuf
Date: Thu Dec 11 2025 - 00:27:53 EST


On Thu, Dec 11, 2025 at 02:06:06AM +0100, Borislav Petkov wrote:
> On Sat, Dec 06, 2025 at 01:41:07PM -0800, Josh Poimboeuf wrote:
> > # ./arch/x86/include/asm/smap.h:47: alternative("", "stac", X86_FEATURE_SMAP);
> > # 47 "./arch/x86/include/asm/smap.h" 1
> > ALTERNATIVE "", "stac", "( 9*32+20)"
>
> Well, that's "readable" but one still needs to go see that ALTERNATIVE
> macro definition now, right?
>
> So you move the gory details somewhere else.
>
> Sorry, I fail to see why we're doing this...

Partially because Linus complains every time I mess up the code gen ;-)
But I like this change too.

Anybody reading the .s file should already know how alternatives work.
If not... go read alternatives.h!

--
Josh