]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/sev: Disentangle #VC handling code from startup code
authorArd Biesheuvel <ardb@kernel.org>
Sun, 4 May 2025 09:52:36 +0000 (11:52 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 5 May 2025 05:07:29 +0000 (07:07 +0200)
commited4d95d033e359f9445e85bf5a768a5859a5830b
treeaf883ae2035423b789c287588fb71b084acaad5c
parent5297886f0cc45db5f4a804caf359e6e7874ee864
x86/sev: Disentangle #VC handling code from startup code

Most of the SEV support code used to reside in a single C source file
that was included in two places: the core kernel, and the decompressor.

The code that is actually shared with the decompressor was moved into a
separate, shared source file under startup/, on the basis that the
decompressor also executes from the early 1:1 mapping of memory.

However, while the elaborate #VC handling and instruction decoding that
it involves is also performed by the decompressor, it does not actually
occur in the core kernel at early boot, and therefore, does not need to
be part of the confined early startup code.

So split off the #VC handling code and move it back into arch/x86/coco
where it came from, into another C source file that is included from
both the decompressor and the core kernel.

Code movement only - no functional change intended.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Dionna Amalie Glaze <dionnaglaze@google.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kevin Loughlin <kevinloughlin@google.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-efi@vger.kernel.org
Link: https://lore.kernel.org/r/20250504095230.2932860-31-ardb+git@google.com
arch/x86/boot/compressed/misc.h
arch/x86/boot/compressed/sev-handle-vc.c
arch/x86/boot/compressed/sev.c
arch/x86/boot/compressed/sev.h
arch/x86/boot/startup/sev-shared.c
arch/x86/boot/startup/sev-startup.c
arch/x86/coco/sev/Makefile
arch/x86/coco/sev/vc-handle.c [new file with mode: 0644]
arch/x86/coco/sev/vc-shared.c [new file with mode: 0644]
arch/x86/include/asm/sev-internal.h
arch/x86/include/asm/sev.h