On Fri, 2023-01-06 at 13:53 -0800, Dave Hansen wrote: > Looks good so far. > > > +/* > > + * Allocate PAMTs from the local NUMA node of some memory in @tmb_list > > + * within @tdmr, and set up PAMTs for @tdmr. > > + */ > > +static int tdmr_set_up_pamt(struct tdmr_info *tdmr, > > + struct list_head *tmb_list, > > + u16 pamt_entry_size) > > +{ > > + unsigned long pamt_base[TDX_PS_1G + 1]; > > + unsigned long pamt_size[TDX_PS_1G + 1]; > > Nit: please define a TDX_PS_NR rather than open-coding this. Will do. > > > + unsigned long tdmr_pamt_base; > > + unsigned long tdmr_pamt_size; > > + struct page *pamt; > > + int pgsz, nid; > > + > > + nid = tdmr_get_nid(tdmr, tmb_list); > > + > > + /* > > + * Calculate the PAMT size for each TDX supported page size > > + * and the total PAMT size. > > + */ > > + tdmr_pamt_size = 0; > > + for (pgsz = TDX_PS_4K; pgsz <= TDX_PS_1G ; pgsz++) { > > + pamt_size[pgsz] = tdmr_get_pamt_sz(tdmr, pgsz, > > + pamt_entry_size); > > This alignment is wonky. Should be way over here: > > > + pamt_entry_size); Will do. > > > + tdmr_pamt_size += pamt_size[pgsz]; > > + } > > + > > [snip] > > Other than the two nits: > > Reviewed-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> > Thanks.