aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/cpuflags.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <[email protected]>2022-04-05 23:29:18 +0000
committerDave Hansen <[email protected]>2022-04-07 15:27:51 +0000
commitae87f609cd52825fa7fa36f02b29e4357fd29eaa (patch)
tree63ece4e59a865b408e8864b19c7c175cdc97928c /arch/x86/boot/cpuflags.c
parentx86/tdx: Add HLT support for TDX guests (diff)
downloadkernel-ae87f609cd52825fa7fa36f02b29e4357fd29eaa.tar.gz
kernel-ae87f609cd52825fa7fa36f02b29e4357fd29eaa.zip
x86/tdx: Add MSR support for TDX guests
Use hypercall to emulate MSR read/write for the TDX platform. There are two viable approaches for doing MSRs in a TD guest: 1. Execute the RDMSR/WRMSR instructions like most VMs and bare metal do. Some will succeed, others will cause a #VE. All of those that cause a #VE will be handled with a TDCALL. 2. Use paravirt infrastructure. The paravirt hook has to keep a list of which MSRs would cause a #VE and use a TDCALL. All other MSRs execute RDMSR/WRMSR instructions directly. The second option can be ruled out because the list of MSRs was challenging to maintain. That leaves option #1 as the only viable solution for the minimal TDX support. Kernel relies on the exception fixup machinery to handle MSR access errors. #VE handler uses the same exception fixup code as #GP. It covers MSR accesses along with other types of fixups. For performance-critical MSR writes (like TSC_DEADLINE), future patches will replace the WRMSR/#VE sequence with the direct TDCALL. RDMSR and WRMSR specification details can be found in Guest-Host-Communication Interface (GHCI) for Intel Trust Domain Extensions (Intel TDX) specification, sec titled "TDG.VP. VMCALL<Instruction.RDMSR>" and "TDG.VP.VMCALL<Instruction.WRMSR>". Co-developed-by: Kuppuswamy Sathyanarayanan <[email protected]> Signed-off-by: Kuppuswamy Sathyanarayanan <[email protected]> Signed-off-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Andi Kleen <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Dave Hansen <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'arch/x86/boot/cpuflags.c')
0 files changed, 0 insertions, 0 deletions