[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aR1fmtagimoLw_5U@tlindgre-MOBL1>
Date: Wed, 19 Nov 2025 08:11:38 +0200
From: Tony Lindgren <tony.lindgren@...ux.intel.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
"Kirill A. Shutemov" <kas@...nel.org>, kvm@...r.kernel.org,
x86@...nel.org, linux-coco@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Jon Kohler <jon@...anix.com>
Subject: Re: [PATCH v2 2/4] KVM: VMX: Handle #MCs on VM-Enter/TD-Enter
outside of the fastpath
On Tue, Nov 18, 2025 at 02:23:26PM -0800, Sean Christopherson wrote:
> Handle Machine Checks (#MC) that happen on VM-Enter (VMX or TDX) outside
> of KVM's fastpath so that as much host state as possible is re-loaded
> before invoking the kernel's #MC handler. The only requirement is that
> KVM invokes the #MC handler before enabling IRQs (and even that could
> _probably_ be related to handling #MCs before enabling preemption).
>
> Waiting to handle #MCs until "more" host state is loaded hardens KVM
> against flaws in the #MC handler, which has historically been quite
> brittle. E.g. prior to commit 5567d11c21a1 ("x86/mce: Send #MC singal from
> task work"), the #MC code could trigger a schedule() with IRQs and
> preemption disabled. That led to a KVM hack-a-fix in commit 1811d979c716
> ("x86/kvm: move kvm_load/put_guest_xcr0 into atomic context").
>
> Note, vmx_handle_exit_irqoff() is common to VMX and TDX guests.
Reviewed-by: Tony Lindgren <tony.lindgren@...ux.intel.com>
Powered by blists - more mailing lists