From: Sean Christopherson <seanjc@google.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: pbonzini@redhat.com, Adrian Hunter <adrian.hunter@intel.com>,
kvm@vger.kernel.org, rick.p.edgecombe@intel.com,
kirill.shutemov@linux.intel.com, kai.huang@intel.com,
reinette.chatre@intel.com, tony.lindgren@linux.intel.com,
binbin.wu@linux.intel.com, isaku.yamahata@intel.com,
linux-kernel@vger.kernel.org, yan.y.zhao@intel.com,
chao.gao@intel.com
Subject: Re: [PATCH V4 0/1] KVM: TDX: Decrease TDX VM shutdown time
Date: Fri, 11 Jul 2025 06:05:10 -0700 [thread overview]
Message-ID: <aHEMBuVieGioMVaT@google.com> (raw)
In-Reply-To: <7103b312-b02d-440e-9fa6-ba219a510c2d@intel.com>
On Fri, Jul 11, 2025, Xiaoyao Li wrote:
> On 6/26/2025 11:58 PM, Sean Christopherson wrote:
> > On Wed, Jun 25, 2025, Sean Christopherson wrote:
> > > On Wed, 11 Jun 2025 12:51:57 +0300, Adrian Hunter wrote:
> > > > 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/aAL4dT1pWG5dDDeo@google.com
> > > >
> > > > [...]
> > >
> > > Applied to kvm-x86 vmx, thanks!
> > >
> > > [1/1] KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VM
> > > https://github.com/kvm-x86/linux/commit/111a7311a016
> >
> > Fixed up to address a docs goof[*], new hash:
> >
> > https://github.com/kvm-x86/linux/commit/e4775f57ad51
> >
> > [*] https://lore.kernel.org/all/20250626171004.7a1a024b@canb.auug.org.au
>
> Hi Sean,
>
> I think it's targeted for v6.17, right?
>
> If so, do we need the enumeration for the new TDX ioctl? Yes, the userspace
> could always try and ignore the failure. But since the ship has not sailed,
> I would like to report it and hear your opinion.
Bugger, you're right. It's sitting at the top of 'kvm-x86 vmx', so it should be
easy enough to tack on a capability.
This?
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index f0d961436d0f..dcb879897cab 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -9147,6 +9147,13 @@ KVM exits with the register state of either the L1 or L2 guest
depending on which executed at the time of an exit. Userspace must
take care to differentiate between these cases.
+8.46 KVM_CAP_TDX_TERMINATE_VM
+-----------------------------
+
+:Architectures: x86
+
+This capability indicates that KVM supports the KVM_TDX_TERMINATE_VM sub-ioctl.
+
9. Known KVM API problems
=========================
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b58a74c1722d..e437a50429d3 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4823,6 +4823,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_READONLY_MEM:
r = kvm ? kvm_arch_has_readonly_mem(kvm) : 1;
break;
+ case KVM_CAP_TDX_TERMINATE_VM:
+ r = !!(kvm_caps.supported_vm_types & BIT(KVM_X86_TDX_VM));
+ break;
default:
break;
}
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 7a4c35ff03fe..54293df4a342 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -960,6 +960,7 @@ struct kvm_enable_cap {
#define KVM_CAP_ARM_EL2 240
#define KVM_CAP_ARM_EL2_E2H0 241
#define KVM_CAP_RISCV_MP_STATE_RESET 242
+#define KVM_CAP_TDX_TERMINATE_VM 243
struct kvm_irq_routing_irqchip {
__u32 irqchip;
next prev parent reply other threads:[~2025-07-11 13:05 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 9:51 [PATCH V4 0/1] KVM: TDX: Decrease TDX VM shutdown time Adrian Hunter
2025-06-11 9:51 ` [PATCH V4 1/1] KVM: TDX: Add sub-ioctl KVM_TDX_TERMINATE_VM Adrian Hunter
2025-06-16 3:40 ` Vishal Annapurve
2025-06-18 5:50 ` Adrian Hunter
2025-06-18 6:00 ` Vishal Annapurve
2025-06-18 8:33 ` Adrian Hunter
2025-06-19 0:33 ` Sean Christopherson
2025-06-19 11:12 ` Adrian Hunter
2025-06-20 14:24 ` Sean Christopherson
2025-06-20 16:14 ` Vishal Annapurve
2025-06-20 16:26 ` Sean Christopherson
2025-06-23 20:36 ` Vishal Annapurve
2025-06-23 21:39 ` Sean Christopherson
2025-06-23 23:35 ` Vishal Annapurve
2025-06-20 18:59 ` Edgecombe, Rick P
2025-06-20 21:21 ` Vishal Annapurve
2025-06-20 23:34 ` Edgecombe, Rick P
2025-06-21 3:00 ` Vishal Annapurve
2025-06-23 16:23 ` Edgecombe, Rick P
2025-06-23 20:22 ` Vishal Annapurve
2025-06-23 22:51 ` Edgecombe, Rick P
2025-06-18 22:07 ` Edgecombe, Rick P
2025-06-23 20:40 ` Vishal Annapurve
2025-06-25 22:25 ` [PATCH V4 0/1] KVM: TDX: Decrease TDX VM shutdown time Sean Christopherson
2025-06-26 15:58 ` Sean Christopherson
2025-06-26 19:52 ` Adrian Hunter
2025-07-11 8:55 ` Xiaoyao Li
2025-07-11 13:05 ` Sean Christopherson [this message]
2025-07-11 13:40 ` Xiaoyao Li
2025-07-11 14:19 ` Sean Christopherson
2025-07-11 22:31 ` Edgecombe, Rick P
2025-07-11 22:54 ` Sean Christopherson
2025-07-11 23:04 ` Edgecombe, Rick P
2025-07-11 23:00 ` Edgecombe, Rick P
2025-07-11 23:05 ` Sean Christopherson
2025-07-11 23:17 ` Edgecombe, Rick P
2025-07-14 3:20 ` Xiaoyao Li
2025-07-14 13:56 ` Sean Christopherson
2025-07-14 15:06 ` Xiaoyao Li
2025-07-16 9:22 ` Xiaoyao Li
2025-07-18 15:35 ` Sean Christopherson
2025-07-17 9:14 ` Nikolay Borisov
2025-07-18 14:36 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aHEMBuVieGioMVaT@google.com \
--to=seanjc@google.com \
--cc=adrian.hunter@intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=chao.gao@intel.com \
--cc=isaku.yamahata@intel.com \
--cc=kai.huang@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=rick.p.edgecombe@intel.com \
--cc=tony.lindgren@linux.intel.com \
--cc=xiaoyao.li@intel.com \
--cc=yan.y.zhao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.