On 25/04/2025 10:57, Adrian Hunter wrote: > +static int tdx_terminate_vm(struct kvm *kvm) > +{ > + if (!kvm_trylock_all_vcpus(kvm)) Introduction of kvm_trylock_all_vcpus() is still in progress: https://lore.kernel.org/r/20250430203013.366479-3-mlevitsk@xxxxxxxxxx/ but it has kvm_trylock_all_vcpus(kvm) return value the other way around, so this will instead need to be: if (kvm_trylock_all_vcpus(kvm)) > + return -EBUSY; > + > + kvm_vm_dead(kvm); > + > + kvm_unlock_all_vcpus(kvm); > + > + tdx_mmu_release_hkid(kvm); > + > + return 0; > +} > + > int tdx_vm_ioctl(struct kvm *kvm, void __user *argp) > { > struct kvm_tdx_cmd tdx_cmd; > @@ -2817,6 +2825,9 @@ int tdx_vm_ioctl(struct kvm *kvm, void __user *argp) > case KVM_TDX_FINALIZE_VM: > r = tdx_td_finalize(kvm, &tdx_cmd); > break; > + case KVM_TDX_TERMINATE_VM: > + r = tdx_terminate_vm(kvm); > + break; > default: > r = -EINVAL; > goto out;