Re: [RFC PATCH v5 024/104] KVM: TDX: create/destroy VM structure

From: Isaku Yamahata
Date: Thu Apr 07 2022 - 20:51:22 EST


On Tue, Apr 05, 2022 at 02:44:04PM +0200,
Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:

> > diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
> > index 6111c6485d8e..5c3a904a30e8 100644
> > --- a/arch/x86/kvm/vmx/main.c
> > +++ b/arch/x86/kvm/vmx/main.c
> > @@ -39,12 +39,24 @@ static int vt_vm_init(struct kvm *kvm)
> > ret = tdx_module_setup();
> > if (ret)
> > return ret;
> > - return -EOPNOTSUPP; /* Not ready to create guest TD yet. */
> > + return tdx_vm_init(kvm);
> > }
> > return vmx_vm_init(kvm);
> > }
> > +static void vt_mmu_prezap(struct kvm *kvm)
> > +{
> > + if (is_td(kvm))
> > + return tdx_mmu_prezap(kvm);
> > +}
>
> Please rename the function to explain what it does, for example
> tdx_mmu_release_hkid.

In the patch 021/104, you suggested flush_shadow_all_private().
Which do you prefer? flush_shadow_all_private or tdx_mmu_release_hkid.
--
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>