[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eacb326a450be89fa49fb90bdfea1f2ed415685a.camel@intel.com>
Date: Mon, 6 May 2024 11:35:10 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Edgecombe,
Rick P" <rick.p.edgecombe@...el.com>
CC: "Hansen, Dave" <dave.hansen@...el.com>, "seanjc@...gle.com"
<seanjc@...gle.com>, "bp@...en8.de" <bp@...en8.de>, "x86@...nel.org"
<x86@...nel.org>, "peterz@...radead.org" <peterz@...radead.org>,
"hpa@...or.com" <hpa@...or.com>, "mingo@...hat.com" <mingo@...hat.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"tglx@...utronix.de" <tglx@...utronix.de>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "jgross@...e.com" <jgross@...e.com>, "Yamahata, Isaku"
<isaku.yamahata@...el.com>
Subject: Re: [PATCH 5/5] x86/virt/tdx: Export global metadata read
infrastructure
On Fri, 2024-05-03 at 18:31 +0000, Edgecombe, Rick P wrote:
> On Fri, 2024-05-03 at 14:17 +1200, Huang, Kai wrote:
> >
> >
> > On 3/05/2024 12:21 pm, Edgecombe, Rick P wrote:
> > > On Sat, 2024-03-02 at 00:20 +1300, Kai Huang wrote:
> > > > KVM will need to read a bunch of non-TDMR related metadata to create and
> > > > run TDX guests. Export the metadata read infrastructure for KVM to use.
> > > >
> > > > Specifically, export two helpers:
> > > >
> > > > 1) The helper which reads multiple metadata fields to a buffer of a
> > > > structure based on the "field ID -> structure member" mapping table.
> > > >
> > > > 2) The low level helper which just reads a given field ID.
> > > >
> > > Could 2 be a static inline in a helper, and then only have one export?
> >
> > I assume you were thinking about making 2) call the 1), so we don't need
> > to export 2).
> >
> > This is not feasible due to:
> >
> > a). 1) must 'struct tdx_metadata_field_mapping' table as input, and for
> > that we need to ues the TDX_SYSINFO_MAP() macro to define a structure
> > for just one 'u64' and define a 'struct tdx_metadata_field_mapping'
> > table which only has one element for that.
> >
> > b). TDX_SYSINFO_MAP() macro actually doesn't support taking a metadata
> > field "variable", but can only support using the name of the metadata field.
> >
> > However we can try to make 1) as a wrapper of 2). But this would
> > require some change to the patch 4.
> >
> > I'll reply separately to patch 4 and you can take a look whether that is
> > better.
>
> Having one export would be nice. Yea, since the multiple field processing
> version just loops anyway, doing it like you propose seems reasonable.
Sure I'll switch to use the new code as replied in patch 4.
Powered by blists - more mailing lists