Re: [PATCH v3 09/21] x86/virt/tdx: Get information about TDX module and convertible memory

From: Kai Huang
Date: Wed May 18 2022 - 19:57:11 EST


On Wed, 2022-05-18 at 15:30 -0700, Sagi Shahar wrote:
> > >
> > > > +   pr_info("TDX module: vendor_id 0x%x, major_version %u, minor_version
> > > > %u, build_date %u, build_num %u",
> > > > +           tdx_sysinfo.vendor_id, tdx_sysinfo.major_version,
> > > > +           tdx_sysinfo.minor_version, tdx_sysinfo.build_date,
> > > > +           tdx_sysinfo.build_num);
> > > > +
> > > > +   /* Print BIOS provided CMRs */
> > > > +   print_cmrs(tdx_cmr_array, cmr_num, "BIOS-CMR");
> > > > +
>
> sanitize_cmrs already prints the cmrs in case of success. So for valid
> cmrs we are going to print them twice.
> Would it be better to only print cmrs here in case sanitize_cmrs fails?

The "BIOS-CMR" will always have 32 entries. It includes all the *empty* CMRs
after the valid CMRs, so the two are different. But yes it seems there's no
need to always print "BIOS-CMR".


--
Thanks,
-Kai