From: Xu Yilun <yilun.xu@linux.intel.com>
To: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: pbonzini@redhat.com, dave.hansen@intel.com, seanjc@google.com,
x86@kernel.org, kas@kernel.org, adrian.hunter@intel.com,
yan.y.zhao@intel.com, binbin.wu@intel.com, xiaoyao.li@intel.com,
chao.gao@intel.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, nik.borisov@suse.com,
tony.lindgren@linux.intel.com
Subject: Re: [PATCH v2 1/2] x86/virt/tdx: Drop tdx_clflush_*()
Date: Tue, 20 Oct 2026 18:56:26 +0800 [thread overview]
Message-ID: <atdI2mPV8HfcSr0I@yilunxu-OptiPlex-7050> (raw)
In-Reply-To: <20261015191710.3632302-2-rick.p.edgecombe@intel.com>
On Thu, Oct 15, 2026 at 12:17:09PM -0700, Rick Edgecombe wrote:
> The TDX module exposes a bit (CLFLUSH_BEFORE_ALLOC) to say whether it
> requires certain types of memory to be flushed from the cache before being
> handed to the TDX module.
>
> During the initial TDX upstreaming, it was decided it would be simplest
> to just always flush rather than checking for the bit and having
> conditional logic. So based on the TDX docs:
> When allocating a memory page to be used as TD private memory or TD
> control structure page, the host VMM is required to ensure that none of
> the cache lines associated with the page is in a MODIFIED state.
>
> ...currently the kernel flushes before handing over private memory and TD
> control structure pages.
>
> The CLFLUSH_BEFORE_ALLOC bit has never been set by any TDX module, so this
> flushing has yet to be needed in practice. Going forward, the TDX docs will
> be updated to clarify that actually CLFLUSH_BEFORE_ALLOC will *never* be
> set in any future TDX module either.
>
> So make code even simpler by just deleting all the CLFLUSH_BEFORE_ALLOC
> handling.
>
> AI was used to review the change.
>
> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
> Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Xu Yilun <yilun.xu@linux.intel.com>
next prev parent reply other threads:[~2026-10-20 11:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 19:17 [PATCH v2 0/2] Drop unneeded cache flushing Rick Edgecombe
2026-10-15 19:17 ` [PATCH v2 1/2] x86/virt/tdx: Drop tdx_clflush_*() Rick Edgecombe
2026-10-20 10:56 ` Xu Yilun [this message]
2026-10-15 19:17 ` [PATCH v2 2/2] x86/virt/tdx: Drop tdh_phymem_page_wbinvd_*() Rick Edgecombe
2026-10-20 8:55 ` Binbin Wu
2026-10-20 10:55 ` Xu Yilun
2026-10-19 8:36 ` [PATCH v2 0/2] Drop unneeded cache flushing Nikolay Borisov
2026-10-21 10:09 ` Kiryl Shutsemau
2026-10-22 9:11 ` Tony Lindgren
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=atdI2mPV8HfcSr0I@yilunxu-OptiPlex-7050 \
--to=yilun.xu@linux.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=nik.borisov@suse.com \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.com \
--cc=tony.lindgren@linux.intel.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®