[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3eefbf7831239e76c93be30e536d34578fa2909f.camel@intel.com>
Date: Tue, 10 Jan 2023 00:49:21 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Hansen, Dave" <dave.hansen@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "Luck, Tony" <tony.luck@...el.com>,
"bagasdotme@...il.com" <bagasdotme@...il.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>,
"peterz@...radead.org" <peterz@...radead.org>,
"Shahar, Sagi" <sagis@...gle.com>,
"imammedo@...hat.com" <imammedo@...hat.com>,
"Gao, Chao" <chao.gao@...el.com>,
"Brown, Len" <len.brown@...el.com>,
"sathyanarayanan.kuppuswamy@...ux.intel.com"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
"Huang, Ying" <ying.huang@...el.com>,
"Williams, Dan J" <dan.j.williams@...el.com>
Subject: Re: [PATCH v8 10/16] x86/virt/tdx: Allocate and set up PAMTs for
TDMRs
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@...ux.intel.com>
>
Thanks.
Powered by blists - more mailing lists