]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/boot: Defer initialization of VM space related global variables
authorArd Biesheuvel <ardb@kernel.org>
Tue, 13 May 2025 11:11:59 +0000 (13:11 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 14 May 2025 08:06:35 +0000 (10:06 +0200)
commit64797551baec252f953fa8234051f88b0c368ed5
treea58dc31c5e0d2799bdfa1070bfa7fb6234607b71
parent891d3b8be32a69ae94d32e3f1e1ee01359020d49
x86/boot: Defer initialization of VM space related global variables

The global pseudo-constants 'page_offset_base', 'vmalloc_base' and
'vmemmap_base' are not used extremely early during the boot, and cannot be
used safely until after the KASLR memory randomization code in
kernel_randomize_memory() executes, which may update their values.

So there is no point in setting these variables extremely early, and it
can wait until after the kernel itself is mapped and running from its
permanent virtual mapping.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250513111157.717727-9-ardb+git@google.com
arch/x86/boot/startup/map_kernel.c
arch/x86/kernel/head64.c