mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "Gao, Chao" <chao.gao@intel.com>
Cc: "Hansen, Dave" <dave.hansen@intel.com>,
	"seanjc@google.com" <seanjc@google.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kas@kernel.org" <kas@kernel.org>,
	"Wu, Binbin" <binbin.wu@intel.com>,
	"Li, Xiaoyao" <xiaoyao.li@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Zhao, Yan Y" <yan.y.zhao@intel.com>,
	"Hunter, Adrian" <adrian.hunter@intel.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 2/2] x86/virt/tdx: Drop tdh_phymem_page_wbinvd_*()
Date: Thu, 24 Sep 2026 18:58:56 +0000	[thread overview]
Message-ID: <066bce5f38f06bf92902c84a73b27989ce9554a4.camel@intel.com> (raw)
In-Reply-To: <arTpHVhVsVnNOK-T@intel.com>

On Thu, 2026-09-24 at 17:10 +0800, Chao Gao 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.
> > 
> > For a similar reasons as why the CLFLUSH_BEFORE_ALLOC features0 bit was
> > 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.
> 
> The reason isn't clear to me. Is it that the hardware doesn't have the
> aliasing problem, or that the TDX module does the flush internally?

For existing platforms, it's that the HW doesn't have the problem. For any
future platform that might need it, whatever is needed could be done inside the
TDX module.

Yea that is important to understand whether new modules are needed for this
change on existing platforms. The answer is no.

> 
> I'm asking because the answer should also tell us whether the kernel still
> needs to set cache_state_incoherent on every SEAMCALL. Not asking to clean
> that up in this series, though.

Oh yea, that's a good point. Hmm. I think it is a similar scenario as Yilun
raised. Basically system level scoped memory reclaim. The assertions I have
don't cover it, and I'm trying to get the answer. I think it will depend on
future platform needs and what can be handled by the TDX module.

But yea, I think we could do that part separately than these two cases.

      reply	other threads:[~2026-09-24 18:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 20:52 [PATCH 0/2] Drop unneeded cache flushing Rick Edgecombe
2026-09-22 20:52 ` [PATCH 1/2] x86/virt/tdx: Drop tdx_clflush_*() Rick Edgecombe
2026-09-23  5:25   ` Yan Zhao
2026-09-23  7:30     ` Binbin Wu
2026-09-23  7:47   ` Tony Lindgren
2026-09-23 15:50     ` Edgecombe, Rick P
2026-09-24  4:44       ` Tony Lindgren
2026-09-23 11:58   ` Nikolay Borisov
2026-09-23 16:26     ` Edgecombe, Rick P
2026-09-23 18:07       ` Nikolay Borisov
2026-09-22 20:52 ` [PATCH 2/2] x86/virt/tdx: Drop tdh_phymem_page_wbinvd_*() Rick Edgecombe
2026-09-23  2:18   ` Xiaoyao Li
2026-09-23 16:31     ` Edgecombe, Rick P
2026-09-23  5:41   ` Yan Zhao
2026-09-23 18:22     ` Edgecombe, Rick P
2026-09-23  7:09   ` Xu Yilun
2026-09-23 18:18     ` Edgecombe, Rick P
2026-09-24  9:10   ` Chao Gao
2026-09-24 18:58     ` Edgecombe, Rick P [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=066bce5f38f06bf92902c84a73b27989ce9554a4.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=adrian.hunter@intel.com \
    --cc=binbin.wu@intel.com \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=yan.y.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®