While the Linux 6.15 merge window ended just one week ago and there is a month and a half until it will debut as stable, a notable feature has already been queued into a “next” branch for the follow-on Linux 6.16 cycle. For those making use of modern Intel Xeon processors with virtualization, the Trust Domain Extensions (TDX) support for KVM virtualization looks like it will finally be mainlined.
Like with some elements of AMD SEV support taking a long time to work their way into the mainline kernel, it’s also been a drawn out process getting all aspects of the Trust Domain Extensions to the mainline tree. An important one looks like it’s now ready for merging the next cycle: Intel TDX for KVM.
This week Paolo Bonzini of Red Hat queued the Intel TDX for KVM support into the KVM kernel code’s “next” branch. With this merge, the Intel TDX support is now positioned for submission when the Linux 6.16 merge window opens in late May or early June. Bonzini explains in that merge message:
“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”
Intel TDX is used for creating Trusted Execution Environments (TEEs) for hardware isolation of VMs from the host environment. There is also remote attestation support with TDX.
Intel TDX was introduced with select SKUs for Sapphire Rapids for cloud providers and reached broader availability with Xeon Emerald Rapids.