Re: [PATCH v7 04/20] x86/virt/tdx: Add skeleton to initialize TDX on demand

From: Huang, Kai
Date: Wed Nov 23 2022 - 16:58:54 EST


On Wed, 2022-11-23 at 08:58 -0800, Dave Hansen wrote:
> On 11/23/22 02:18, Huang, Kai wrote:
> > > Again, there are a lot of words in that comment, but I'm not sure why
> > > it's here. Despite all the whinging about ACPI, doesn't it boil down to:
> > >
> > > The TDX module itself establishes its own concept of how many
> > > logical CPUs there are in the system when it is loaded.
> > >
> > This isn't accurate. TDX MCHECK records the total number of logical CPUs when
> > the BIOS enables TDX. This happens before the TDX module is loaded. In fact
> > the TDX module only gets this information from a secret location.
>
> Kai, this is the point where I lose patience with the conversation
> around this series. I'll you paste you the line of code where the TDX
> module literally "establishes its own concept of how many logical CPUs
> there are in the system":
>
> > //NUM_LPS
> > tdx_global_data_ptr->num_of_lps = sysinfo_table_ptr->mcheck_fields.tot_num_lps;
>
> Yes, this is derived directly from MCHECK. But, this concept is
> separate from MCHECK. We have seen zero actual facts from you or other
> folks at Intel that this is anything other than an arbitrary choice made
> for the convenience of the TDX module. It _might_ not be this way. I'm
> open to hearing those facts and changing my position on this.
>
> But, please bring facts, not random references to "secret locations"
> that aren't that secret.

Agreed. Thanks for providing the comment and will use it.