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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2022-03-28 at 13:30 -0700, Dave Hansen wrote:
> On 3/28/22 13:22, Isaku Yamahata wrote:
> > > > > +	/*
> > > > > +	 * Also a sane BIOS should never generate invalid CMR(s) between
> > > > > +	 * two valid CMRs.  Sanity check this and simply return error in
> > > > > +	 * this case.
> > > > > +	 */
> > > > > +	for (j = i; j < cmr_num; j++)
> > > > > +		if (cmr_valid(&cmr_array[j])) {
> > > > > +			pr_err("Firmware bug: invalid CMR(s) among valid CMRs.\n");
> > > > > +			return -EFAULT;
> > > > > +		}
> > > > This check doesn't make sense because above i-for loop has break.
> > > The break in above i-for loop will hit at the first invalid CMR entry.  Yes "j =
> > > i" will make double check on this invalid CMR entry, but it should have no
> > > problem.  Or we can change to "j = i + 1" to skip the first invalid CMR entry.
> > > 
> > > Does this make sense?
> > It makes sense. Somehow I missed j = i. I scratch my review.
> 
> You can also take it as something you might want to refactor, add
> comments, or work on better variable names.  If it confused one person,
> it will confuse more in the future.

Hi Dave,

OK I'll think over whether I can improve.  Thanks for advice.

Btw if you have time, could you help to review this series? Or could you take a
look at whether the overall design is OK, for instance, the design limitations
described in the cover letter?

-- 
Thanks,
-Kai





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux