[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d8d20f62f82e052893fa32368d6a228a2140728.camel@intel.com>
Date: Tue, 29 Mar 2022 12:40:35 +1300
From: Kai Huang <kai.huang@...el.com>
To: Dave Hansen <dave.hansen@...el.com>,
Isaku Yamahata <isaku.yamahata@...il.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
seanjc@...gle.com, pbonzini@...hat.com,
kirill.shutemov@...ux.intel.com,
sathyanarayanan.kuppuswamy@...ux.intel.com, peterz@...radead.org,
tony.luck@...el.com, ak@...ux.intel.com, dan.j.williams@...el.com,
isaku.yamahata@...el.com
Subject: Re: [PATCH v2 09/21] x86/virt/tdx: Get information about TDX module
and convertible memory
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
Powered by blists - more mailing lists