aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/sev-shared.c
diff options
context:
space:
mode:
authorGravatar Ard Biesheuvel <ardb@kernel.org> 2024-02-27 16:19:15 +0100
committerGravatar Borislav Petkov (AMD) <bp@alien8.de> 2024-03-04 18:12:33 +0100
commit48204aba801f1b512b3abed10b8e1a63e03f3dd1 (patch)
tree646ce4afa18759544ea7f3a9bd60c9038d1de92b /arch/x86/kernel/sev-shared.c
parentx86/boot: Move mem_encrypt= parsing to the decompressor (diff)
downloadlinux-48204aba801f1b512b3abed10b8e1a63e03f3dd1.tar.gz
linux-48204aba801f1b512b3abed10b8e1a63e03f3dd1.tar.bz2
linux-48204aba801f1b512b3abed10b8e1a63e03f3dd1.zip
x86/sme: Move early SME kernel encryption handling into .head.text
The .head.text section is the initial primary entrypoint of the core kernel, and is entered with the CPU executing from a 1:1 mapping of memory. Such code must never access global variables using absolute references, as these are based on the kernel virtual mapping which is not active yet at this point. Given that the SME startup code is also called from this early execution context, move it into .head.text as well. This will allow more thorough build time checks in the future to ensure that early startup code only uses RIP-relative references to global variables. Also replace some occurrences of __pa_symbol() [which relies on the compiler generating an absolute reference, which is not guaranteed] and an open coded RIP-relative access with RIP_REL_REF(). 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-18-ardb+git@google.com
Diffstat (limited to 'arch/x86/kernel/sev-shared.c')
0 files changed, 0 insertions, 0 deletions