[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whrcutH0LcMmaeJxxMeYpw2R5T80yoQAXbrRHNSTCB0Pw@mail.gmail.com>
Date: Tue, 6 May 2025 09:23:13 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Ard Biesheuvel <ardb@...nel.org>, Ingo Molnar <mingo@...nel.org>
Subject: Re: [RFC PATCH 3/3] x86/boot: Use alternatives based selector for
5-level paging constants
On Tue, 6 May 2025 at 08:49, Ard Biesheuvel <ardb+git@...gle.com> wrote:
>
> + asm_inline(ALTERNATIVE_TERNARY("jmp 6f; 8:", %c[feat], "movl %[yes], %[ret]", "")
> + " .pushsection .altinstr_aux,\"ax\" \n"
> + "6: pushfq \n"
> + " testb $1, %a[l5en] \n"
> + " jz 7f \n"
> + " movl %[yes], %[ret] \n"
> + "7: popfq \n"
> + " jmp 8b \n"
> + " .popsection \n"
> + : [ret] "+rm" (ret)
> + : [feat] "i" (X86_FEATURE_LA57),
> + [yes] "i" (yes),
> + [l5en] "i" (&__pgtable_l5_enabled));
I really detest these things. I don't think it's worth the complexity.
Is there really such a hot path somewhere that we should do something
like this?
If we can't use some existing infrastructure for this, we should just
keep it simple. Not write ten lines of specialized inline asm.
Linus
Powered by blists - more mailing lists