[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1144340e-dd95-ee3b-dabb-579f9a65b3c7@citrix.com>
Date: Thu, 16 Feb 2023 19:46:48 +0000
From: Andrew Cooper <andrew.cooper3@...rix.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Dave Hansen <dave.hansen@...el.com>,
Borislav Petkov <bp@...en8.de>
Cc: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Isaku Yamahata <isaku.yamahata@...el.com>, x86@...nel.org,
linux-coco@...ts.linux.dev, kexec@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] x86/kexec: Preserve CR4.MCE during kexec
On 13/02/2023 11:48 pm, Kirill A. Shutemov wrote:
> TDX guests are not allowed to clear CR4.MCE. Attempt to clear it leads
> to #VE.
>
> Preserve the flag during kexec.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
That's unfortunate for TDX, but in a non-TDX system you must never
maintain CR4.MCE into kexec.
Async events, including NMIs, cannot be taken between this point and the
target having set itself up into it's intended operating mode. During
this period you get all kinds of fun with type confusion in the IDT/TSS
and/or not having a safe stack to service the event.
A clean shutdown from not having machine checks enabled is far
preferable to trying to deliver an #MC in purgatory.
That, or you're welcome to debug the next bug report I get where
(amazingly) an NMI managed to hit with a good stack in the new context,
but most of the old context (IDT, TSS and .text) still intact enough to
start emitting a very confused oops onto serial...
~Andrew
Powered by blists - more mailing lists