From: Dave Hansen <dave.hansen@intel.com>
To: Sean Christopherson <seanjc@google.com>, Kai Huang <kai.huang@intel.com>
Cc: bp@alien8.de, tglx@linutronix.de, peterz@infradead.org,
mingo@redhat.com, hpa@zytor.com, thomas.lendacky@amd.com,
x86@kernel.org, kas@kernel.org, rick.p.edgecombe@intel.com,
dwmw@amazon.co.uk, linux-kernel@vger.kernel.org,
pbonzini@redhat.com, kvm@vger.kernel.org,
reinette.chatre@intel.com, isaku.yamahata@intel.com,
dan.j.williams@intel.com, ashish.kalra@amd.com,
nik.borisov@suse.com, chao.gao@intel.com, sagis@google.com,
farrah.chen@intel.com, Binbin Wu <binbin.wu@linux.intel.com>
Subject: Re: [PATCH v7 7/7] KVM: TDX: Explicitly do WBINVD when no more TDX SEAMCALLs
Date: Tue, 26 Aug 2025 10:18:17 -0700 [thread overview]
Message-ID: <a578e3b5-9fd3-4f69-943f-9415f4047e19@intel.com> (raw)
In-Reply-To: <aK3qfbvkCOaCxWC_@google.com>
On 8/26/25 10:10, Sean Christopherson wrote:
>> +void tdx_cpu_flush_cache_for_kexec(void)
>> +{
>> + lockdep_assert_preemption_disabled();
>> +
>> + if (!this_cpu_read(cache_state_incoherent))
>> + return;
>> +
> Can you add a comment here to explain why this is done even if the kernel doesn't
> support kexec? I've no objection to the superfluous flushing, but I've spent far
> too much time deciphering old commits where the changelog says one thing and the
> code does something else with no explanation. I don't want to be party to such
> crimes 🙂
You mean as opposed to #ifdef'ing it out?
Looking at the code again, I completely agree in concept. The connection
between TDX, kexec and 'cache_state_incoherent' is totally opaque.
next prev parent reply other threads:[~2025-08-26 17:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 22:58 [PATCH v7 0/7] TDX host: kexec/kdump support Kai Huang
2025-08-25 22:58 ` [PATCH v7 1/7] x86/kexec: Consolidate relocate_kernel() function parameters Kai Huang
2025-08-26 17:28 ` David Woodhouse
2025-08-25 22:58 ` [PATCH v7 2/7] x86/sme: Use percpu boolean to control WBINVD during kexec Kai Huang
2025-08-25 22:58 ` [PATCH v7 3/7] x86/virt/tdx: Mark memory cache state incoherent when making SEAMCALL Kai Huang
2025-08-25 22:58 ` [PATCH v7 4/7] x86/kexec: Disable kexec/kdump on platforms with TDX partial write erratum Kai Huang
2025-08-25 22:58 ` [PATCH v7 5/7] x86/virt/tdx: Remove the !KEXEC_CORE dependency Kai Huang
2025-08-25 22:58 ` [PATCH v7 6/7] x86/virt/tdx: Update the kexec section in the TDX documentation Kai Huang
2025-08-25 22:58 ` [PATCH v7 7/7] KVM: TDX: Explicitly do WBINVD when no more TDX SEAMCALLs Kai Huang
2025-08-26 17:10 ` Sean Christopherson
2025-08-26 17:18 ` Dave Hansen [this message]
2025-08-26 23:31 ` Edgecombe, Rick P
2025-08-26 17:20 ` Paolo Bonzini
2025-08-26 17:38 ` Sean Christopherson
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=a578e3b5-9fd3-4f69-943f-9415f4047e19@intel.com \
--to=dave.hansen@intel.com \
--cc=ashish.kalra@amd.com \
--cc=binbin.wu@linux.intel.com \
--cc=bp@alien8.de \
--cc=chao.gao@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dwmw@amazon.co.uk \
--cc=farrah.chen@intel.com \
--cc=hpa@zytor.com \
--cc=isaku.yamahata@intel.com \
--cc=kai.huang@intel.com \
--cc=kas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nik.borisov@suse.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=reinette.chatre@intel.com \
--cc=rick.p.edgecombe@intel.com \
--cc=sagis@google.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
/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®