[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRWe4VGgJdocYbHw@yzhao56-desk.sh.intel.com>
Date: Thu, 13 Nov 2025 17:03:29 +0800
From: Yan Zhao <yan.y.zhao@...el.com>
To: "Huang, Kai" <kai.huang@...el.com>
CC: "Du, Fan" <fan.du@...el.com>, "Li, Xiaoyao" <xiaoyao.li@...el.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "Hansen, Dave"
<dave.hansen@...el.com>, "david@...hat.com" <david@...hat.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>, "tabba@...gle.com"
<tabba@...gle.com>, "vbabka@...e.cz" <vbabka@...e.cz>, "kas@...nel.org"
<kas@...nel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "seanjc@...gle.com" <seanjc@...gle.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>, "binbin.wu@...ux.intel.com"
<binbin.wu@...ux.intel.com>, "ackerleytng@...gle.com"
<ackerleytng@...gle.com>, "michael.roth@....com" <michael.roth@....com>,
"Weiny, Ira" <ira.weiny@...el.com>, "Peng, Chao P" <chao.p.peng@...el.com>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>, "Annapurve, Vishal"
<vannapurve@...gle.com>, "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
"Miao, Jun" <jun.miao@...el.com>, "x86@...nel.org" <x86@...nel.org>,
"pgonda@...gle.com" <pgonda@...gle.com>
Subject: Re: [RFC PATCH v2 03/23] x86/tdx: Enhance
tdh_phymem_page_wbinvd_hkid() to invalidate huge pages
On Thu, Nov 13, 2025 at 03:37:29PM +0800, Huang, Kai wrote:
>
> Thanks for all the explanation.
>
> [...]
>
>
> > In [6], the new folio_page() implementation is
> >
> > static inline struct page *folio_page(struct folio *folio, unsigned long n)
> > {
> > return &folio->page + n;
> > }
> >
> > So, invoking folio_page() should be equal to page++ in our case.
> >
> > [6] https://lore.kernel.org/kvm/20250901150359.867252-13-david@redhat.com
>
> Sure. But it seems you will need to wait all patches that you mentioned to
> be merged to safely use 'page++' for pages in a folio?
Correct.
> And if you do:
>
> for (i = 0; i < npages; i++)
> {
> struct page *p = folio_page(folio, start_idx + i);
> struct tdx_module_args args = {};
>
> args.rcx = mk_keyed_paddr(hkid, p);
> ...
> }
>
> It should work w/o any dependency?
>
> Anyway, I don't have any strong opinion, as long as it works. You may
> choose what you want. :-)
I don't have a strong opinion either. However, based on previous reviews, it
seems people prefer while (npages--) over introducing an additional variable.
I guess I'll choose a version depending on whether these patches are merged when
I post the next version. :)
Powered by blists - more mailing lists