Re: [PATCH v11 13/21] KVM: selftests: Add helpers to init TDX memory and finalize VM
From: Ira Weiny
Date: Wed Oct 15 2025 - 12:25:40 EST
Sagi Shahar wrote:
> From: Ackerley Tng <ackerleytng@xxxxxxxxxx>
>
[snip]
> diff --git a/tools/testing/selftests/kvm/lib/x86/tdx/tdx_util.c b/tools/testing/selftests/kvm/lib/x86/tdx/tdx_util.c
> index 2551b3eac8f8..53cfadeff8de 100644
> --- a/tools/testing/selftests/kvm/lib/x86/tdx/tdx_util.c
> +++ b/tools/testing/selftests/kvm/lib/x86/tdx/tdx_util.c
> @@ -270,3 +270,61 @@ void vm_tdx_init_vm(struct kvm_vm *vm, uint64_t attributes)
>
> free(init_vm);
> }
> +
[snip]
> +
> +void vm_tdx_finalize(struct kvm_vm *vm)
Why is this not a new kvm_arch_vm_finalize_vcpu() call?
Ira
> +{
> + load_td_private_memory(vm);
> + vm_tdx_vm_ioctl(vm, KVM_TDX_FINALIZE_VM, 0, NULL);
> +}
> --
> 2.51.0.536.g15c5d4f767-goog
>