linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/1] KVM: TDX: Decrease TDX VM shutdown time
@ 2025-04-25  7:57 Adrian Hunter
  2025-04-25  7:57 ` [PATCH V3 1/1] KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VM Adrian Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2025-04-25  7:57 UTC (permalink / raw)
  To: pbonzini, seanjc
  Cc: mlevitsk, kvm, rick.p.edgecombe, kirill.shutemov, kai.huang,
	reinette.chatre, xiaoyao.li, tony.lindgren, binbin.wu,
	isaku.yamahata, linux-kernel, yan.y.zhao, chao.gao

Hi

Changes in V3:
	Refer:
            https://lore.kernel.org/r/aAL4dT1pWG5dDDeo@google.com

	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/20250313181629.17764-1-adrian.hunter@intel.com/

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 the assumed result
of Maxim's work-in-progress here:

      https://lore.kernel.org/all/20250409014136.2816971-1-mlevitsk@redhat.com/

Note it is assumed that kvm_trylock_all_vcpus(kvm) follows the return value
semantics of mutex_trylock() i.e. 1 means locks have been successfully
acquired, 0 means not succesful.


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                   | 63 ++++++++++++++++++++++----------
 3 files changed, 61 insertions(+), 19 deletions(-)


Regards
Adrian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-06 19:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25  7:57 [PATCH V3 0/1] KVM: TDX: Decrease TDX VM shutdown time Adrian Hunter
2025-04-25  7:57 ` [PATCH V3 1/1] KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VM Adrian Hunter
2025-05-11  8:57   ` Adrian Hunter
2025-06-06 14:53     ` Adrian Hunter
2025-06-06 19:17   ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).