Skip to content

KVM: TDX: Decrease TDX VM shutdown time

Adrian Hunter kvm lkml 3 versions – Applied

Status from this message: Applied to kvm-x86 vmx, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest1 patch 41 repliesApplied
  2. v31 patch 3 repliesSuperseded
  3. v21 patch 6 repliesSuperseded

Changes in V3 from the cover letter

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/1KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VMDocumentation/virt/kvm/x86/intel-tdx.rst arch/x86/include/uapi/asm/kvm.h arch/x86/kvm/vmx/tdx.c+43 -821 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchVishal AnnapurveXiaoyao Li
SeriesT-b R-b T-b
1/1A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH V4 0/1] KVM: TDX: Decrease TDX VM shutdown time

Hi

Changes in V4:

Drop TDX_FLUSHVP_NOT_DONE change. It will be done separately. Use KVM_BUG_ON() instead of WARN_ON().
Correct kvm_trylock_all_vcpus() return value.

Changes in V3:
Refer:
https://lore.kernel.org/r/[email protected]

Remove KVM_BUG_ON() from tdx_mmu_release_hkid() because it would trigger on the error path from __tdx_td_init()

Put cpus_read_lock() handling back into tdx_mmu_release_hkid()

Handle KVM_TDX_TERMINATE_VM in the switch statement, i.e. let tdx_vm_ioctl() deal with kvm->lock

The version 1 RFC:

	https://lore.kernel.org/all/[email protected]/

listed 3 options and implemented option 2. Sean replied with code for option 1, which tested out OK, so here it is plus a commit log.

It depends upon kvm_trylock_all_vcpus(kvm) which is now upstream:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e4a454ced74c0ac97c8bd32f086ee3ad74528780

Sean Christopherson (1):
KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VM

 Documentation/virt/kvm/x86/intel-tdx.rst | 16 +++++++++++++++
 arch/x86/include/uapi/asm/kvm.h          |  1 +
 arch/x86/kvm/vmx/tdx.c                   | 34 ++++++++++++++++++++++++--------
 3 files changed, 43 insertions(+), 8 deletions(-)

Regards
Adrian