From: "Huang, Kai" <kai.huang@intel.com>
To: "Hansen, Dave" <dave.hansen@intel.com>,
"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
"bp@alien8.de" <bp@alien8.de>,
"peterz@infradead.org" <peterz@infradead.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>
Cc: "seanjc@google.com" <seanjc@google.com>,
"x86@kernel.org" <x86@kernel.org>,
"sagis@google.com" <sagis@google.com>,
"Chatre, Reinette" <reinette.chatre@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"Yamahata, Isaku" <isaku.yamahata@intel.com>,
"ashish.kalra@amd.com" <ashish.kalra@amd.com>,
"nik.borisov@suse.com" <nik.borisov@suse.com>
Subject: Re: [PATCH v3 1/6] x86/sme: Use percpu boolean to control wbinvd during kexec
Date: Fri, 27 Jun 2025 00:37:45 +0000 [thread overview]
Message-ID: <065b56f9743a18aa1866153a146a18b46df9ef8f.camel@intel.com> (raw)
In-Reply-To: <ffcb59ff61de9b3189cf1f1cc2f331c5d0b54170.camel@intel.com>
(I'll address all wording comments, as always.)
> > Today the first WBINVD in the stop_this_cpu() is performed when SME is
> > *supported* by the platform, and the second WBINVD is done in
> > relocate_kernel() when SME is *activated* by the kernel. Make things
> > simple by changing to do the second WBINVD when the platform supports
> > SME. This allows the kernel to simply turn on this percpu boolean when
> > bringing up a CPU by checking whether the platform supports SME.
>
> Since the race is related to stop_this_cpu() it doesn't affect it. But it does
> mean that the bring up CPU may not flush the cache if takes a kdump kexec before
> the per-cpu var is set? Of course the existing logic doesn't trigger until
> cpuinfo_x86 is populated. What is the consequence?
See another reply.
>
> Arguably the supported/enabled part could be moved to a separate earlier patch.
> The code change would just get immediately replaced, but the benefit would be
> that a bisect would show which part of the change was responsible.
I am not a fan of splitting the new variable and the user into different
patches, as long as the patch isn't too big to review. You need to review
them together anyway I think, so arguably putting them together is easier to
review.
next prev parent reply other threads:[~2025-06-27 0:37 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 10:48 [PATCH v3 0/6] TDX host: kexec/kdump support Kai Huang
2025-06-26 10:48 ` [PATCH v3 1/6] x86/sme: Use percpu boolean to control wbinvd during kexec Kai Huang
2025-06-26 17:59 ` Edgecombe, Rick P
2025-06-26 18:42 ` Edgecombe, Rick P
2025-06-27 0:30 ` Huang, Kai
2025-06-30 7:09 ` Binbin Wu
2025-06-27 0:37 ` Huang, Kai [this message]
2025-06-27 0:39 ` Edgecombe, Rick P
2025-06-27 1:06 ` Huang, Kai
2025-06-27 15:08 ` Tom Lendacky
2025-06-30 11:35 ` Huang, Kai
2025-06-28 12:50 ` Borislav Petkov
2025-06-28 17:04 ` Tom Lendacky
2025-06-30 11:34 ` Huang, Kai
2025-06-30 11:34 ` Huang, Kai
2025-07-01 12:12 ` Borislav Petkov
2025-07-02 3:06 ` Huang, Kai
2025-06-26 10:48 ` [PATCH v3 2/6] x86/virt/tdx: Mark memory cache state incoherent when making SEAMCALL Kai Huang
2025-06-26 18:37 ` Edgecombe, Rick P
2025-06-26 23:36 ` Huang, Kai
2025-06-27 0:52 ` Edgecombe, Rick P
2025-06-27 1:47 ` Huang, Kai
2025-06-26 10:48 ` [PATCH v3 3/6] x86/kexec: Disable kexec/kdump on platforms with TDX partial write erratum Kai Huang
2025-06-26 18:49 ` Edgecombe, Rick P
2025-07-01 5:37 ` Binbin Wu
2025-07-02 3:12 ` Huang, Kai
2025-07-02 8:25 ` Chao Gao
2025-07-02 8:43 ` Huang, Kai
2025-07-02 22:16 ` Vishal Annapurve
2025-07-02 23:57 ` Edgecombe, Rick P
2025-06-26 10:48 ` [PATCH v3 4/6] x86/virt/tdx: Remove the !KEXEC_CORE dependency Kai Huang
2025-06-26 18:49 ` Edgecombe, Rick P
2025-06-26 10:48 ` [PATCH v3 5/6] x86/virt/tdx: Update the kexec section in the TDX documentation Kai Huang
2025-06-26 18:51 ` Edgecombe, Rick P
2025-06-26 10:48 ` [PATCH v3 6/6] KVM: TDX: Explicitly do WBINVD upon reboot notifier Kai Huang
2025-06-27 0:01 ` Edgecombe, Rick P
2025-06-27 1:00 ` Huang, Kai
2025-07-01 6:09 ` Binbin Wu
2025-07-02 3:14 ` Huang, Kai
2025-07-02 7:54 ` Chao Gao
2025-07-02 9:22 ` Huang, Kai
2025-07-07 12:37 ` Huang, Kai
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=065b56f9743a18aa1866153a146a18b46df9ef8f.camel@intel.com \
--to=kai.huang@intel.com \
--cc=ashish.kalra@amd.com \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=isaku.yamahata@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--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;
as well as URLs for NNTP newsgroup(s).