[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3b70404aaf634cca9199b917a9987ccdb3a66b0.camel@intel.com>
Date: Fri, 26 Sep 2025 22:05:12 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "Zhao, Yan Y" <yan.y.zhao@...el.com>
CC: "Gao, Chao" <chao.gao@...el.com>, "seanjc@...gle.com" <seanjc@...gle.com>,
"Huang, Kai" <kai.huang@...el.com>, "kas@...nel.org" <kas@...nel.org>,
"Annapurve, Vishal" <vannapurve@...gle.com>, "bp@...en8.de" <bp@...en8.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mingo@...hat.com" <mingo@...hat.com>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-coco@...ts.linux.dev" <linux-coco@...ts.linux.dev>, "Yamahata, Isaku"
<isaku.yamahata@...el.com>, "pbonzini@...hat.com" <pbonzini@...hat.com>,
"tglx@...utronix.de" <tglx@...utronix.de>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v3 12/16] x86/virt/tdx: Add helpers to allow for
pre-allocating pages
On Fri, 2025-09-26 at 09:44 +0800, Yan Zhao wrote:
> > - return kvm_mmu_topup_memory_cache(&tdx-
> > >mmu_external_spt_cache,
> > - PT64_ROOT_MAX_LEVEL);
> > + /* External page tables */
> > + min_fault_cache_size = PT64_ROOT_MAX_LEVEL;
>
> min_fault_cache_size = PT64_ROOT_MAX_LEVEL - 1?
> We don't need to allocate page for the root page.
Why change it in this patch?
>
> > + /* Dynamic PAMT pages (if enabled) */
> > + min_fault_cache_size += tdx_dpamt_entry_pages() *
> > PT64_ROOT_MAX_LEVEL;
> > +
> What about commenting that it's
> tdx_dpamt_entry_pages() * ((PT64_ROOT_MAX_LEVEL - 1) + 1) ?
> i.e.,
> (PT64_ROOT_MAX_LEVEL - 1) for page table pages, and 1 for guest
> private page.
Yes the comment could be improved. I'll enhance it. Thanks.
Powered by blists - more mailing lists