On Thu, Apr 17, 2025 at 6:20 AM Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote: > > ... > +static int tdx_terminate_vm(struct kvm *kvm) > +{ > + int r = 0; > + > + guard(mutex)(&kvm->lock); > + cpus_read_lock(); > + > + if (!kvm_trylock_all_vcpus(kvm)) { Does this need to be a trylock variant? Is userspace expected to keep retrying this operation indefinitely? > + r = -EBUSY; > + goto out; > + } > + > + kvm_vm_dead(kvm); > + kvm_unlock_all_vcpus(kvm); > + > + __tdx_release_hkid(kvm, true); > +out: > + cpus_read_unlock(); > + return r; > +} > +