diff options
| author | Kuppuswamy Sathyanarayanan <[email protected]> | 2022-04-05 23:29:21 +0000 |
|---|---|---|
| committer | Dave Hansen <[email protected]> | 2022-04-07 15:27:51 +0000 |
| commit | 4b05f81504bfcaab51083d3a271fada75e6b8904 (patch) | |
| tree | fcb76e069a285a4bf3c11b78560754cd46aa931a /arch/x86/boot/compressed/misc.h | |
| parent | x86/tdx: Handle in-kernel MMIO (diff) | |
| download | kernel-4b05f81504bfcaab51083d3a271fada75e6b8904.tar.gz kernel-4b05f81504bfcaab51083d3a271fada75e6b8904.zip | |
x86/tdx: Detect TDX at early kernel decompression time
The early decompression code does port I/O for its console output. But,
handling the decompression-time port I/O demands a different approach
from normal runtime because the IDT required to support #VE based port
I/O emulation is not yet set up. Paravirtualizing I/O calls during
the decompression step is acceptable because the decompression code
doesn't have a lot of call sites to IO instruction.
To support port I/O in decompression code, TDX must be detected before
the decompression code might do port I/O. Detect whether the kernel runs
in a TDX guest.
Add an early_is_tdx_guest() interface to query the cached TDX guest
status in the decompression code.
TDX is detected with CPUID. Make cpuid_count() accessible outside
boot/cpuflags.c.
TDX detection in the main kernel is very similar. Move common bits
into <asm/shared/tdx.h>.
The actual port I/O paravirtualization will come later in the series.
Signed-off-by: Kuppuswamy Sathyanarayanan <[email protected]>
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Reviewed-by: Tony Luck <[email protected]>
Reviewed-by: Dave Hansen <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'arch/x86/boot/compressed/misc.h')
| -rw-r--r-- | arch/x86/boot/compressed/misc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h index 16ed360b6692..0d8e275a9d96 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -28,6 +28,8 @@ #include <asm/bootparam.h> #include <asm/desc_defs.h> +#include "tdx.h" + #define BOOT_CTYPE_H #include <linux/acpi.h> |
