x86/boot/compressed: Move startup32_check_sev_cbit() into .text
authorArd Biesheuvel <ardb@kernel.org>
Tue, 22 Nov 2022 16:10:13 +0000 (17:10 +0100)
committerBorislav Petkov <bp@suse.de>
Thu, 24 Nov 2022 07:57:41 +0000 (08:57 +0100)
commitb5d854cd4b6a314edd6c15dabc4233b84a0f8e5e
treedde32200057b6e4a7fb77e7eddeb682e8b6be078
parent9ea813be3d345dfb8ac5bf6fbb29e6a63647a39d
x86/boot/compressed: Move startup32_check_sev_cbit() into .text

Move startup32_check_sev_cbit() into the .text section and turn it into
an ordinary function using the ordinary 32-bit calling convention,
instead of saving/restoring the registers that are known to be live at
the only call site. This improves maintainability, and makes it possible
to move this function out of head_64.S and into a separate compilation
unit that is specific to memory encryption.

Note that this requires the call site to be moved before the mixed mode
check, as %eax will be live otherwise.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20221122161017.2426828-14-ardb@kernel.org
arch/x86/boot/compressed/head_64.S