summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-02-27 18:19:12 +0300
committerBorislav Petkov (AMD) <bp@alien8.de>2024-03-04 20:12:20 +0300
commit828263957611c210da00c1820db73fac217135b6 (patch)
tree7ace6a300437ac4e0cc76f9f42e7cc1b7f6af1dc /drivers/md
parentd6a41f184dcea0814260af2780e147022c11dca8 (diff)
downloadlinux-828263957611c210da00c1820db73fac217135b6.tar.xz
x86/startup_64: Simplify virtual switch on primary boot
The secondary startup code is used on the primary boot path as well, but in this case, the initial part runs from a 1:1 mapping, until an explicit cross-jump is made to the kernel virtual mapping of the same code. On the secondary boot path, this jump is pointless as the code already executes from the mapping targeted by the jump. So combine this cross-jump with the jump from startup_64() into the common boot path. This simplifies the execution flow, and clearly separates code that runs from a 1:1 mapping from code that runs from the kernel virtual mapping. Note that this requires a page table switch, so hoist the CR3 assignment into startup_64() as well. And since absolute symbol references will no longer be permitted in .head.text once we enable the associated build time checks, a RIP-relative memory operand is used in the JMP instruction, referring to an absolute constant in the .init.rodata section. Given that the secondary startup code does not require a special placement inside the executable, move it to the .text section. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Tested-by: Tom Lendacky <thomas.lendacky@amd.com> Link: https://lore.kernel.org/r/20240227151907.387873-15-ardb+git@google.com
Diffstat (limited to 'drivers/md')
0 files changed, 0 insertions, 0 deletions