[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d71540ab13e728d1326baae92e8ea82d00c08abe.camel@intel.com>
Date: Sat, 26 Oct 2024 01:12:52 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "Li, Xiaoyao" <xiaoyao.li@...el.com>, "Hunter, Adrian"
<adrian.hunter@...el.com>, "yuan.yao@...ux.intel.com"
<yuan.yao@...ux.intel.com>
CC: "seanjc@...gle.com" <seanjc@...gle.com>, "Huang, Kai"
<kai.huang@...el.com>, "isaku.yamahata@...il.com" <isaku.yamahata@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tony.lindgren@...ux.intel.com" <tony.lindgren@...ux.intel.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "Yamahata, Isaku" <isaku.yamahata@...el.com>,
"sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>
Subject: Re: [PATCH 18/25] KVM: TDX: Do TDX specific vcpu initialization
On Mon, 2024-10-21 at 16:35 +0800, Xiaoyao Li wrote:
> >
> > How about adding it to the docs?
>
> OK for me.
Can you propose something?
>
> > >
> > > It's architectural valid that userspace VMM creates a TD with legacy
> > > topology, i.e., topology enumerated via CPUID 0x1 and 0x4.
> > >
> > > > In that case, do you see a need for the vanilla tdh_vp_init() SEAMCALL
> > > > wrapper?
> > > >
> > > > The TDX module version we need already supports enum_topology, so the
> > > > code:
> > > > if (modinfo->tdx_features0 &
> > > > MD_FIELD_ID_FEATURES0_TOPOLOGY_ENUM)
> > > > err = tdh_vp_init_apicid(tdx, vcpu_rcx, vcpu->vcpu_id);
> > > > else
> > > > err = tdh_vp_init(tdx, vcpu_rcx);
> > > >
> > > > The tdh_vp_init() branch shouldn't be hit.
> > >
> > > We cannot know what version of TDX module user might use thus we cannot
> > > assume enum_topology is always there unless we make it a hard
> > > requirement in KVM that TDX fails being enabled when
> > >
> > > !(modinfo->tdx_features0 & MD_FIELD_ID_FEATURES0_TOPOLOGY_ENUM)
> >
> > We will depend on bugs that are fixed in TDX Modules after enum topology, so
> > it
> > shouldn't be required in the normal case. So I think it would be simpler to
> > add
> > this tdx_features0 conditional. We can then export one less SEAMCALL and
> > will
> > have less configurations flows to worry about on the KVM side.
>
> I'm a little bit confused. what does "add this tdx_feature0 conditional"
> mean?
I was talking about your suggestion to check for
MD_FIELD_ID_FEATURES0_TOPOLOGY_ENUM.
Powered by blists - more mailing lists