From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "tglx@linutronix.de" <tglx@linutronix.de>,
"peterz@infradead.org" <peterz@infradead.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"Hansen, Dave" <dave.hansen@intel.com>,
"Huang, Kai" <kai.huang@intel.com>, "bp@alien8.de" <bp@alien8.de>
Cc: "ashish.kalra@amd.com" <ashish.kalra@amd.com>,
"seanjc@google.com" <seanjc@google.com>,
"x86@kernel.org" <x86@kernel.org>,
"sagis@google.com" <sagis@google.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"Chatre, Reinette" <reinette.chatre@intel.com>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>,
"Yamahata, Isaku" <isaku.yamahata@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"nik.borisov@suse.com" <nik.borisov@suse.com>
Subject: Re: [PATCH] x86/virt/tdx: Make TDX and kexec mutually exclusive at runtime
Date: Thu, 17 Apr 2025 18:21:13 +0000 [thread overview]
Message-ID: <ea0b0b1a842ad1fc209438c776f68ffb4ac17b9f.camel@intel.com> (raw)
In-Reply-To: <7bd03311-0c4c-41e6-b6dc-803b6455f170@intel.com>
On Thu, 2025-04-17 at 10:50 -0700, Dave Hansen wrote:
> On 4/16/25 16:02, Kai Huang wrote:
> > Full support for kexec on a TDX host would require complex work.
> > The cache flushing required would need to happen while stopping
> > remote CPUs, which would require changes to a fragile area of the
> > kernel.
>
> Doesn't kexec already stop remote CPUs? Doesn't this boil down to a
> WBINVD? How is that complex?
When SME added an SME-only WBINVD in stop_this_cpu() it caused a shutdown hang
on some particular HW. It turns out there was an existing race that was made
worse by the slower operation. It went through some attempts to fix it, and
finally tglx patched it up with:
1f5e7eb7868e ("x86/smp: Make stop_other_cpus() more robust")
But in that patch he said the fix "cannot plug all holes either". So while
looking at doing the WBINVD for TDX kexec, I was advocating for giving this a
harder look before building on top of it. The patches to add TDX kexec support
made the WBINVD happen on all bare metal, not just TDX HW. So whatever races
exist would be exposed to a much wider variety of HW than SME tested out.
>
> > It would also require resetting TDX private pages, which is non-
> > trivial since the core kernel does not track them.
>
> Why? The next kernel will just use KeyID-0 which will blast the old
> pages away with no side effects... right?
I believe this is talking about support to work around the #MC errata. Another
version of kexec TDX support used a KVM callback to have it reset all the TDX
guest memory it knows about.
>
> > Lastly, it would have to rely on a yet-to-be documented behavior
> > around the TME key (KeyID 0).
>
> I'll happily wait for the documentation if you insist on it (I don't).
Ok, thanks. This one is probably more of a bonus reason on top of the above.
next prev parent reply other threads:[~2025-04-17 18:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 23:02 Kai Huang
2025-04-17 17:07 ` Edgecombe, Rick P
2025-04-17 17:50 ` Dave Hansen
2025-04-17 18:21 ` Edgecombe, Rick P [this message]
2025-04-17 18:56 ` Dave Hansen
2025-04-22 4:10 ` Huang, Kai
2025-05-07 21:03 ` Edgecombe, Rick P
2025-05-07 23:49 ` 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=ea0b0b1a842ad1fc209438c776f68ffb4ac17b9f.camel@intel.com \
--to=rick.p.edgecombe@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=kai.huang@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--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=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®