Merge branch 'kvm-tdx-enter-exit' into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 12 Mar 2025 11:38:46 +0000 (07:38 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Mar 2025 18:26:28 +0000 (14:26 -0400)
commit77ab80c6bda044a716da2d2022f6d93e46c052ac
treee555d39c523e9391cf7055a21e96855a76503285
parentfcbe34825a99c4f6bc9344193c83864cbc4f907e
parent484612f1a7d7386cec8fc9a3fa9dd45dd39e8b6d
Merge branch 'kvm-tdx-enter-exit' into HEAD

This series introduces callbacks to facilitate the entry of a TD VCPU
and the corresponding save/restore of host state.

A TD VCPU is entered via the SEAMCALL TDH.VP.ENTER. The TDX Module manages
the save/restore of guest state and, in conjunction with the SEAMCALL
interface, handles certain aspects of host state. However, there are
specific elements of the host state that require additional attention, as
detailed in the Intel TDX ABI documentation for TDH.VP.ENTER.

TDX is quite different from VMX in this regard.  For VMX, the host VMM is
heavily involved in restoring, managing and saving guest CPU state, whereas
for TDX this is handled by the TDX Module.  In that way, the TDX Module can
protect the confidentiality and integrity of TD CPU state.

The TDX Module does not save/restore all host CPU state because the host
VMM can do it more efficiently and selectively.  CPU state referred to
below is host CPU state.  Often values are already held in memory so no
explicit save is needed, and restoration may not be needed if the kernel
is not using a feature.

TDX does not support PAUSE-loop exiting.  According to the TDX Module
Base arch. spec., hypercalls are expected to be used instead.  Note that
the Linux TDX guest supports existing hypercalls via TDG.VP.VMCALL.

This series requires TDX module 1.5.06.00.0744, or later, due to removal
of the workarounds for the lack of the NO_RBP_MOD feature required by the
kernel. NO_RBP_MOD is now required.