[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3f77974-f1d6-4a22-bd1d-2678427a9fb1@intel.com>
Date: Wed, 25 Jun 2025 11:06:16 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
pbonzini@...hat.com, seanjc@...gle.com, dave.hansen@...ux.intel.com
Cc: rick.p.edgecombe@...el.com, isaku.yamahata@...el.com,
kai.huang@...el.com, yan.y.zhao@...el.com, chao.gao@...el.com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, kvm@...r.kernel.org,
x86@...nel.org, linux-coco@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 02/12] x86/virt/tdx: Allocate page bitmap for Dynamic
PAMT
> /*
> * Locate a NUMA node which should hold the allocation of the @tdmr
> * PAMT. This node will have some memory covered by the TDMR. The
> @@ -522,7 +534,16 @@ static int tdmr_set_up_pamt(struct tdmr_info *tdmr,
> * and the total PAMT size.
> */
> tdmr_pamt_size = 0;
> - for (pgsz = TDX_PS_4K; pgsz < TDX_PS_NR; pgsz++) {
> + pgsz = TDX_PS_4K;
> +
> + /* With Dynamic PAMT, PAMT_4K is replaced with a bitmap */
> + if (tdx_supports_dynamic_pamt(&tdx_sysinfo)) {
> + pamt_size[pgsz] = tdmr_get_pamt_bitmap_sz(tdmr);
> + tdmr_pamt_size += pamt_size[pgsz];
> + pgsz++;
> + }
This is the wrong place to do this.
Hide it in tdmr_get_pamt_sz(). Don't inject it in the main code flow
here and complicate the for loop.
Powered by blists - more mailing lists