All of lore.kernel.org
 help / color / mirror / Atom feed
From: Binbin Wu <binbin.wu@linux.intel.com>
To: Yan Zhao <yan.y.zhao@intel.com>,
	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,
	binbin.wu@intel.com, xiaoyao.li@intel.com, chao.gao@intel.com,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/virt/tdx: Drop tdx_clflush_*()
Date: Wed, 23 Sep 2026 15:30:11 +0800	[thread overview]
Message-ID: <7698d2fc-fd72-4772-a017-a4a16f34cda6@linux.intel.com> (raw)
In-Reply-To: <arNirJownovqY66q@yzhao56-desk.sh.intel.com>

On 9/23/2026 1:25 PM, Yan Zhao wrote:
> On Tue, Sep 22, 2026 at 01:52:14PM -0700, Rick Edgecombe wrote:
>> The TDX module exposes a bit (CLFLUSH_BEFORE_ALLOC) to say whether it
>> requires some memory to be flushed from the cache before being handed
> Drop "some"?
> 
>> to the TDX module.
>>
>> During the initial TDX upstreaming, it was decided it would be simplest
>> to just always flush in these cases, rather than checking for the bit and
> "in these cases" is ambiguous.

I assume "some memory" and "these cases" refer to memory pages allocated for
TD private memory or TD control structures. I agree with Yan that it would be
better to just state that explicitly.

> 
>> having conditional logic. So currently the kernel flushes in several
>> places when handing memory to the TDX module.
>>
>> In practice this bit has never been set by any TDX module, so flushing
>> is unneeded. Going forward the TDX docs will be updated to clarify that
> "Going forward, ...".
> 
>> 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: Binbin Wu <binbin.wu@linux.intel.com>

  reply	other threads:[~2026-09-23  7:30 UTC|newest]

Thread overview: 20+ 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 [this message]
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-10-12 12:50       ` Xiaoyao Li
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

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=7698d2fc-fd72-4772-a017-a4a16f34cda6@linux.intel.com \
    --to=binbin.wu@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=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.