History

Merge branch 'kvm-tdx-initial' into HEAD

This large commit contains the initial support for TDX in KVM. All x86 parts enable the host-side hypercalls that KVM uses to talk to the TDX module, a software component that runs in a special CPU mode called SEAM (Secure Arbitration Mode). The series is in turn split into multiple sub-series, each with a separate merge commit: - Initialization: basic setup for using the TDX module from KVM, plus ioctls to create TDX VMs and vCPUs. - MMU: in TDX, private and shared halves of the address space are mapped by different EPT roots, and the private half is managed by the TDX module. Using the support that was added to the generic MMU code in 6.14, add support for TDX's secure page tables to the Intel side of KVM. Generic KVM code takes care of maintaining a mirror of the secure page tables so that they can be queried efficiently, and ensuring that changes are applied to both the mirror and the secure EPT. - vCPU enter/exit: implement the callbacks that handle the entry of a TDX vCPU (via the SEAMCALL TDH.VP.ENTER) and the corresponding save/restore of host state. - Userspace exits: introduce support for guest TDVMCALLs that KVM forwards to userspace. These correspond to the usual KVM_EXIT_* "heavyweight vmexits" but are triggered through a different mechanism, similar to VMGEXIT for SEV-ES and SEV-SNP. - Interrupt handling: support for virtual interrupt injection as well as handling VM-Exits that are caused by vectored events. Exclusive to TDX are machine-check SMIs, which the kernel already knows how to handle through the kernel machine check handler (commit 7911f145de5f, "x86/mce: Implement recovery for errors in TDX/SEAM non-root mode") - Loose ends: handling of the remaining exits from the TDX module, including EPT violation/misconfig and several TDVMCALL leaves that are handled in the kernel (CPUID, HLT, RDMSR/WRMSR, GetTdVmCallInfo); plus returning an error or ignoring operations that are not supported by TDX guests

Paolo Bonzini committed 1 year ago

Commit fd02aa42 parents 7d76856 7bcf72455 files · +6822 −583Browse files

Showing the changes to include/uapi (1 of 55 files). Show all

Unified · Split

include/uapi/linux/kvm.h+1−0
@@ -375,6 +375,7 @@ struct kvm_run { · 374 unmodified lines
375#define KVM_SYSTEM_EVENT_WAKEUP 4375#define KVM_SYSTEM_EVENT_WAKEUP 4
376#define KVM_SYSTEM_EVENT_SUSPEND 5376#define KVM_SYSTEM_EVENT_SUSPEND 5
377#define KVM_SYSTEM_EVENT_SEV_TERM 6377#define KVM_SYSTEM_EVENT_SEV_TERM 6
378#define KVM_SYSTEM_EVENT_TDX_FATAL 7
378 __u32 type;379 __u32 type;
379 __u32 ndata;380 __u32 ndata;
380 union {381 union {