Re: [PATCH v6 01/11] x86/virt/tdx: Simplify tdmr_get_pamt_sz()
From: Edgecombe, Rick P
Date: Tue Jul 07 2026 - 15:19:26 EST
On Tue, 2026-07-07 at 11:24 +0800, Yan Zhao wrote:
> On Tue, Jul 07, 2026 at 04:18:25AM +0800, Edgecombe, Rick P wrote:
> > On Fri, 2026-07-03 at 13:48 +0800, Chao Gao wrote:
> > > On Mon, May 25, 2026 at 07:35:05PM -0700, Rick Edgecombe wrote:
> > > > Since the loop that iterates over it is gone, further simplify the code by
> Nit:
> The patch is titled "Simplify tdmr_get_pamt_sz()" but the log mainly talks about
> removing the loop in tdmr_set_up_pamt().
> So, how about renaming the patch to "Simplify setting up pamt calculation for
> TDMRs"?
Hmm, yea. I'll change it to:
x86/virt/tdx: Simplify PAMT layout calculation
>
> > > > dropping the array of intermediate size and base storage. Just store the
> > > > values to their final locations.
> > >
> > > > Accept the small complication of having
> > > > to clear tdmr->pamt_4k_base in the error path, so that tdmr_do_pamt_func()
> > > > will not try to operate on the TDMR struct when attempting to free it.
> > >
> > > The clearing of tdmr->pamt_4k_base was dropped, so this section is a bit
> > > stale. Apart from this nit,
> >
> > Oh, good point.
>
> With those nits fixed,
>
> Reviewed-by: Yan Zhao <yan.y.zhao@xxxxxxxxx>
Thanks.