From: Sean Christopherson <seanjc@google.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"x86@kernel.org" <x86@kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Guilherme G . Piccoli" <gpiccoli@igalia.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH v3 0/3] x86/crash: Fix double NMI shootdown bug
Date: Tue, 15 Nov 2022 16:56:31 +0000 [thread overview]
Message-ID: <Y3PEv9MmQ+y91Ir+@google.com> (raw)
In-Reply-To: <5b8787b8-16e9-13dc-7fca-0dc441d673f9@citrix.com>
On Tue, Nov 15, 2022, Andrew Cooper wrote:
> On 14/11/2022 23:34, Sean Christopherson wrote:
> > Tom,
> >
> > I Cc'd you this time around because the APM doesn't explicitly state that
> > GIF is set when EFER.SVME is disabled. KVM's nSVM emulation does set GIF
> > in this case, but it's not clear whether or not KVM is making up behavior.
> > If clearing EFER.SVME doesn't set GIF, then patch 1 needs to be modified
> > to try STGI before clearing EFER.SVME, e.g. if a crash is initiated from
> > KVM between CLGI and STGI. Responding CPUs are "safe" because GIF=0 also
> > blocks NMIs, but the initiating CPU might leave GIF=0 when jumping into
> > the new kernel.
>
> GIF exists independently of EFER.SVME.
>
> It is also gets set by the SKINIT instruction, which is why there is an
> asymmetry on the #UD conditions of STGI and CLGI.
>
> STGI is also intended to be used by the DLME once critical
> initialisation is done, hence why it's dependent on EFER.SVME || SKINIT.
Gah, stupid APM. The pseudocode states "EFER.SVME || CPUID.SKINIT", but the
description and the comment both say that SVM must be enabled to execute SKINIT,
which made me hope that disabling SVM would reset everything.
This instruction generates a #UD exception if SVM is not enabled. See “Enabling
SVM” in AMD64 Architecture Programmer’s Manual Volume 2: System Instructions,
order# 24593.
...
IF ((EFER.SVME == 0) && !(CPUID 8000_0001.ECX[SKINIT]) || (!PROTECTED_MODE))
EXCEPTION [#UD] // This instruction can only be executed
// in protected mode with SVM enabled
^^^^^^^^^^^
next prev parent reply other threads:[~2022-11-15 16:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 23:34 [PATCH v3 0/3] x86/crash: Fix double NMI shootdown bug Sean Christopherson
2022-11-14 23:34 ` [PATCH v3 1/3] x86/crash: Disable virt in core NMI crash handler to avoid double shootdown Sean Christopherson
2022-11-14 23:34 ` [PATCH v3 2/3] x86/reboot: Disable virtualization in an emergency if SVM is supported Sean Christopherson
2022-11-14 23:34 ` [PATCH v3 3/3] x86/virt: Fold __cpu_emergency_vmxoff() into its sole caller Sean Christopherson
2022-11-15 0:32 ` [PATCH v3 0/3] x86/crash: Fix double NMI shootdown bug Andrew Cooper
2022-11-15 16:56 ` Sean Christopherson [this message]
2022-11-15 18:34 ` Tom Lendacky
2022-11-15 19:58 ` Andrew Cooper
2022-11-15 15:33 ` Guilherme G. Piccoli
2022-11-15 19:36 ` Sean Christopherson
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=Y3PEv9MmQ+y91Ir+@google.com \
--to=seanjc@google.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=gpiccoli@igalia.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=vkuznets@redhat.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