Re: [PATCH v10 005/108] KVM: TDX: Initialize the TDX module when loading the KVM intel kernel module

From: Huang, Kai
Date: Mon Nov 14 2022 - 20:58:22 EST


On Mon, 2022-11-14 at 15:18 -0800, Isaku Yamahata wrote:
> > > +struct tdx_capabilities {
> > > + u8 tdcs_nr_pages;
> > > + u8 tdvpx_nr_pages;
> > > +
> > > + u64 attrs_fixed0;
> > > + u64 attrs_fixed1;
> > > + u64 xfam_fixed0;
> > > + u64 xfam_fixed1;
> > > +
> > > + u32 nr_cpuid_configs;
> > > + struct tdx_cpuid_config cpuid_configs[TDX_MAX_NR_CPUID_CONFIGS];
> > > +};
> > > +
> > > +/* Capabilities of KVM + the TDX module. */
> > > +static struct tdx_capabilities tdx_caps;
> >
> > I think you can introduce this tdx_capabilities in another patch.
> >
> > As claimed this patch can just focus on initializing the TDX module. 
> > Whether
> > you need this tdx_capabilities or tdx_sysinfo is enough can be done in the
> > patch
> > when they are really needed.  It makes review easier otherwise people won't
> > be
> > able to tell why tdx_capabilities is needed here.
>
> Ok, the previous patch ("x86/virt/tdx: Add a helper function to return
> system wide info about TDX module ") and this part will be moved right before
> the
> first use of tdx_caps. "KVM: TDX: create/destroy VM structure"

I think it's OK to put all host dependency patches at the beginning of the
series, but just move 'tdx_capabilities' to the patch where it is needed.