Re: [PATCH 2/2] x86/virt/tdx: Drop tdh_phymem_page_wbinvd_*()
From: Edgecombe, Rick P
Date: Wed Sep 23 2026 - 14:28:42 EST
On Wed, 2026-09-23 at 13:41 +0800, Yan Zhao wrote:
> On Tue, Sep 22, 2026 at 01:52:15PM -0700, Rick Edgecombe wrote:
> > In the early days of TDX it was expected that pages being reclaimed from
> > the TDX module would need any cacheline from their private KeyID alias
> > flushed. The TDX docs describe doing this in a couple cases, for example
> > reclaiming the TDR memory:
> > Flush MODIFIED cache lines: this is required to avoid corruption due to
> > cache line aliasing. Note that all cache lines for all other TD pages
> > must have been flushed before the TDR page was reclaimed.
> Is the spec quote necessary?
> The mention of "Note that all cache lines for all other TD pages must have
> been flushed before the TDR page was reclaimed" seems irrelevant to this
> patch.
Hmm, I might switch to the other quote from the ABI spec that covers private
guest memory and TD control structures. It mostly covers everything.
>
> > For a similar reasons as why the CLFLUSH_BEFORE_ALLOC features0 bit was
> s/reasons/reason
Yep, thanks.
>
> > never actually set in any TDX module, this flush of the private KeyID
> > cachelines turned out to not be needed by the final TDX solution. However,
> > the TDX docs were never updated to reflect that.
> >
> > Since private KeyID virtual mappings are reserved for TDX use, the TDX
> > module has to do the clflush itself. The TDH.PHYMEM.PAGE.WBINVD SEAMCALL
> > leaf was created for this purpose.
> Should this paragraph appear before the last one "For a similar..."?
Let me enhance this per Yilun's doubts.