[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e35c61ca34f985fa866b8781bc22c590337c330d.camel@intel.com>
Date: Tue, 10 Feb 2026 10:54:59 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "seanjc@...gle.com" <seanjc@...gle.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "linux-coco@...ts.linux.dev"
<linux-coco@...ts.linux.dev>, "Li, Xiaoyao" <xiaoyao.li@...el.com>, "Zhao,
Yan Y" <yan.y.zhao@...el.com>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "kas@...nel.org" <kas@...nel.org>,
"binbin.wu@...ux.intel.com" <binbin.wu@...ux.intel.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>, "mingo@...hat.com"
<mingo@...hat.com>, "Yamahata, Isaku" <isaku.yamahata@...el.com>,
"ackerleytng@...gle.com" <ackerleytng@...gle.com>, "tglx@...nel.org"
<tglx@...nel.org>, "sagis@...gle.com" <sagis@...gle.com>, "Edgecombe, Rick P"
<rick.p.edgecombe@...el.com>, "bp@...en8.de" <bp@...en8.de>, "Annapurve,
Vishal" <vannapurve@...gle.com>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [RFC PATCH v5 20/45] KVM: x86/mmu: Allocate/free S-EPT pages
using tdx_{alloc,free}_control_page()
>
> Doesn't work, because sp->external_spt will be non-NULL when KVM is freeing
> unused pages in tdp_mmu_split_huge_pages_root() and kvm_tdp_mmu_map(). That's
> solvable, but it's part of the asymmetry I don't love. AFAICT, unless we do
> something truly awful, there's no way to avoid having common KVM free unused
> S-EPT pages.
>
> That said, while I don't love the asymmetry, it's not a deal breaker, especially
> if we make the asymmetry super obvious and cleanly delineated. Specifically, if
> we differentiate between freeing unused page tables and freeing used (linked at
> any point) page tables.
>
> This would also allow us to address the naming than Yan doesn't like around
> reclaim_external_sp(), because we could have both free_external_sp() and
> free_unused_external_spt(), where the lack of "unused" gives the reader a hint
> that there's interesting work to be done for in-use external page tables.
>
> This won't apply cleanly due to other fixups. It's also at:
That's a bit unfortunate.
I hate to say, but should we just use option 1? :-)
As Dave mentioned, we can always improve the locking when there's real
performance issue.
Powered by blists - more mailing lists