From: "Huang, Kai" <kai.huang@intel.com>
To: "kirill.shutemov@linux.intel.com" <kirill.shutemov@linux.intel.com>
Cc: "luto@kernel.org" <luto@kernel.org>,
"ashish.kalra@amd.com" <ashish.kalra@amd.com>,
"Hansen, Dave" <dave.hansen@intel.com>,
"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"seanjc@google.com" <seanjc@google.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"bhe@redhat.com" <bhe@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"nik.borisov@suse.com" <nik.borisov@suse.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"Gao, Chao" <chao.gao@intel.com>, "bp@alien8.de" <bp@alien8.de>,
"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v3 1/5] x86/kexec: do unconditional WBINVD for bare-metal in stop_this_cpu()
Date: Thu, 11 Apr 2024 13:53:38 +0000 [thread overview]
Message-ID: <cdcae76739811b452d66e17554c9b324433a2f1e.camel@intel.com> (raw)
In-Reply-To: <bvtzoqizxzz5ltepttwxu7nlny3najrci6reuybdfwcxpcpqtd@ixovf5h32j62>
On Thu, 2024-04-11 at 16:31 +0300, Kirill A. Shutemov wrote:
> On Thu, Apr 11, 2024 at 09:54:13AM +1200, Huang, Kai wrote:
> >
> >
> > On 11/04/2024 2:12 am, Kirill A. Shutemov wrote:
> > > On Mon, Apr 08, 2024 at 12:44:54AM +1200, Kai Huang wrote:
> > > > TL;DR:
> > >
> > > The commit message is waaay too verbose for no good reason. You don't
> > > really need to repeat all the history around this code.
> >
> > Could you be more specific?
> >
> > I was following Boris's suggestion to summerize all the discussion around
> > the "unconditional WBINVD" issue.
> >
> > https://lore.kernel.org/linux-kernel/20240228110207.GCZd8Sr8mXHA2KTiLz@fat_crate.local/
> >
> > I can try to improve if I can know specifically what should be trimmed down.
>
> What about something like this:
>
> x86/mm: Do unconditional WBINVD in stop_this_cpu() for bare metal
>
> Both AMD SME and Intel TDX can leave caches in an incoherent state due to
> memory encryption, which can lead to silent memory corruption during kexec. To
> address this issue, it is necessary to flush the caches before jumping to the
> second kernel.
>
> Previously, the kernel only performed WBINVD in stop_this_cpu() when SME
> support was detected. To support TDX as well, instead of adding vendor-specific
> checks, it is proposed to unconditionally perform WBINVD. Kexec() is a slow
> path, and the additional WBINVD is acceptable for the sake of simplicity and
> maintainability.
>
> It is important to note that WBINVD should only be done for bare-metal
> scenarios, as TDX guests and SEV-ES/SEV-SNP guests may not handle unexpected
> exceptions (#VE or #VC) caused by WBINVD.
>
> Historically, there were issues with unconditional WBINVD, leading to system
> hangs or resets on different Intel systems. These issues were addressed by a
> series of commits, culminating in the fix provided by commit 1f5e7eb7868e
> ("x86/smp: Make stop_other_cpus() more robust").
>
> Further testing on problematic machines confirmed that the issues could not be
> reproduced after applying the fix. Therefore, it is now safe to unconditionally
> perform WBINVD in stop_this_cpu().
>
> You can also add links to relevant threads as Link: tags.
>
Hmm.. The last two paragraphs doesn't tell the background that the
"unconditional WBINVD" was the original way to do etc. The changelog of commit
1f5e7eb7868e ("x86/smp: Make stop_other_cpus() more robust" (and the commit IDs
that it mentions) doesn't tell the full story either.
That means people will need to open all the Links to get the full information.
I think it is against what Boris suggested.
Yeah I agree having a lengthy changelog is annoying sometimes, but for this
particular case we have a "TL;DR" so doesn't seem that bad to me. :-)
So for now I would like to keep the text after the "Note:" in my original
changelog, but I will use your first 3 paragraphs above to replace mine.
next prev parent reply other threads:[~2024-04-11 13:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-07 12:44 [PATCH v3 0/5] TDX host: kexec() support Kai Huang
2024-04-07 12:44 ` [PATCH v3 1/5] x86/kexec: do unconditional WBINVD for bare-metal in stop_this_cpu() Kai Huang
2024-04-10 14:12 ` Kirill A. Shutemov
2024-04-10 21:54 ` Huang, Kai
2024-04-11 13:31 ` Kirill A. Shutemov
2024-04-11 13:53 ` Huang, Kai [this message]
2024-04-15 17:59 ` Borislav Petkov
2024-04-15 21:43 ` Huang, Kai
2024-04-10 16:08 ` Tom Lendacky
2024-04-10 16:14 ` Tom Lendacky
2024-04-10 22:26 ` Huang, Kai
2024-04-11 14:13 ` Tom Lendacky
2024-04-11 21:55 ` Huang, Kai
2024-04-07 12:44 ` [PATCH v3 2/5] x86/kexec: do unconditional WBINVD for bare-metal in relocate_kernel() Kai Huang
2024-04-10 14:15 ` Kirill A. Shutemov
2024-04-10 16:21 ` Tom Lendacky
2024-04-10 22:55 ` Huang, Kai
2024-04-11 14:25 ` Tom Lendacky
2024-04-11 21:59 ` Huang, Kai
2024-04-07 12:44 ` [PATCH v3 3/5] x86/kexec: Reset TDX private memory on platforms with TDX erratum Kai Huang
2024-04-07 12:44 ` [PATCH v3 4/5] x86/virt/tdx: Remove the !KEXEC_CORE dependency Kai Huang
2024-04-07 12:44 ` [PATCH v3 5/5] x86/virt/tdx: Add TDX memory reset notifier to reset other private pages Kai Huang
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=cdcae76739811b452d66e17554c9b324433a2f1e.camel@intel.com \
--to=kai.huang@intel.com \
--cc=ashish.kalra@amd.com \
--cc=bhe@redhat.com \
--cc=bp@alien8.de \
--cc=chao.gao@intel.com \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=nik.borisov@suse.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.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
Powered by JetHome