[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whRNPK7hTtPYh3SEe0WXEHR=aedc3bc-y_e08ujOxmgJg@mail.gmail.com>
Date: Tue, 6 May 2025 11:17:09 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Ard Biesheuvel <ardb+git@...gle.com>, linux-kernel@...r.kernel.org, x86@...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 10:53, Ard Biesheuvel <ardb@...nel.org> wrote:
>
> The very first thing we do when entering the core kernel is populate
> the page tables, and this uses all the macros and #define's that are
> based on pgtable_l5_enabled(). Alternatives patching occurs *much*
> later.
.. but that's my *point*.
If you depend on pgtable_l5_enabled() when you set up early paging,
you likely also depend on ptrs_per_p4d.
And if you depend on that, then you depend on having run check_la57_support().
And we should have some way to *verify* that, rather than say "you can
use pgtable_l5_enabled randomly early".
Maybe we could have a "early alternatives fixup" for this. I thnk
RISC-V does something like that, where it has separate early
alternatives fixup.
The early boot alternatives code fixup should be really easy - no need
to worry about IPIs and things like that.
Hmm?
Linus
Powered by blists - more mailing lists