Re: [PATCH v2 10/11] x86/alternatives: Simplify ALTERNATIVE_n()

From: Borislav Petkov
Date: Fri Sep 15 2023 - 08:08:30 EST


On Fri, Sep 15, 2023 at 09:51:06AM +0200, Peter Zijlstra wrote:
> > So I see what you did with that @n argument, but urgh, do we really need
> > this? I mean, it just makes things harder to use and it doesn't actually
> > fix anything.. :/

It only addresses this repeating of the 661 labels:

# 53 "./arch/x86/include/asm/page_64.h" 1
# ALT: oldnstr
661:
# ALT: oldnstr
661:
call clear_page_orig #
662:

but this is only the produced asm which no one but me and you look at so
I guess it is not worth the effort.

I still think, though, that adding the comments explaining the situation
more is worth it because we will forget.

> That is, if we can magic this using __COUNTER__ without a user interface
> penalty, then sure. But the last time I tried that I failed utterly and
> ended up with labels like:
>
> .Lalt_old___COUNTER__:
>
> no matter how many layers of CPP macro eval I stuck in it. So clearly I
> wasn't having a good day ....

Yeah, I tried it too because Matz said it should work with it but
I failed too. Reportedly, the approach should be to do that in CPP and
use CPP even for the asm macro but my CPP-fu is basic, to say the least.

I'll poke him next time we meet - I might've missed an aspect.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette