mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Borisov <nik.borisov@suse.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"Gao, Chao" <chao.gao@intel.com>,
	"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>,
	"Hunter, Adrian" <adrian.hunter@intel.com>,
	"Zhao, Yan Y" <yan.y.zhao@intel.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/2] x86/virt/tdx: Drop tdx_clflush_*()
Date: Wed, 23 Sep 2026 21:07:12 +0300	[thread overview]
Message-ID: <486830fe-5b79-441e-bea4-c09241081923@suse.com> (raw)
In-Reply-To: <4527da9ddff360149bbc6ed8aadfc44dfc40c53b.camel@intel.com>



On 23.09.26 г. 19:26 ч., Edgecombe, Rick P wrote:
> On Wed, 2026-09-23 at 14:58 +0300, Nikolay Borisov wrote:
>> The code change itself is trivial, however nothing in the code being
>> removed is tied to CLFLUSH_BEFORE_ALLOC directly. And from the changelog
>> it's not entirely clear which those operations are (as per other
>> reviewers feedback). Looking at the TDX module spec that flag is
>> mentioned in relation to the following 3 operations:
>>
>> TDH.MEM.SEPT.ADD
>> TDH.MEM.PAGE.ADD
>> TDH.MEM.PAGE.AUG
>>
>> Whereas the patch also removes flushing from MNG_CREATE/VP_ADDCX/MNG_ADDCX
> 
> The docs are a bit too ambiguous for my preference, but in the "ABI spec" it has
> this blurb:
>     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.
> 
> So those others should be covered by "TD control structures". It would have been
> nice if these bits were included in the base spec flows too. But I think it's a
> symptom of that this arch was never really needed.
> 
> Similarly, for the system scoped memory that can have reclaim, I would have
> expected that the HW limitation reasoning would be the same as the TD scoped
> memory. But the docs are even less clear on that point. So the docs were never
> super clear on how this should work in general.
> 
> Instead we have the original intention of the Linux code, and some recent
> promises from TDX arch folks:
>   - CLFLUSH_BEFORE_ALLOC will not be set in the future
>   - VMM is not required to call TDH.PHYMEM.PAGE.WBIND on page reclaim on any
>     platforms supporting TDX.
> 
> Does it seem sufficient?

In my opinion the above contains important historical detail and it 
would be good that it's not lost so putting it, probably slightly 
rephrased and/or summarised in the changelog will be beneficial.

> 
>>
>>
>> So concrete references in the changelog would be much appreciated i.e
>> whether flushing for those 3 additional functions was because people
>> were overzealous, or they simply have been omitted from the public
>> documentation.
> 
> I'll try to add something to the effect of the above, if it explains it enough.

Works for me, thanks!



  reply	other threads:[~2026-09-23 18:07 UTC|newest]

Thread overview: 16+ 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-23 11:58   ` Nikolay Borisov
2026-09-23 16:26     ` Edgecombe, Rick P
2026-09-23 18:07       ` Nikolay Borisov [this message]
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

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=486830fe-5b79-441e-bea4-c09241081923@suse.com \
    --to=nik.borisov@suse.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 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®