]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
x86/virt: Force GIF=1 prior to disabling SVM (for reboot flows)
authorSean Christopherson <seanjc@google.com>
Wed, 30 Nov 2022 23:36:48 +0000 (23:36 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:26 +0000 (16:47 +0100)
commit00cfbaf5ff3208ef0efe274977c98e3fb0ee7996
treea9ee6b8b9a00560336e01c0fb0d5a15ce336b98d
parentb543e652140f0161351a0b02c058ab33c40041c9
x86/virt: Force GIF=1 prior to disabling SVM (for reboot flows)

BugLink: https://bugs.launchpad.net/bugs/2011425
commit 6a3236580b0b1accc3976345e723104f74f6f8e6 upstream.

Set GIF=1 prior to disabling SVM to ensure that INIT is recognized if the
kernel is disabling SVM in an emergency, e.g. if the kernel is about to
jump into a crash kernel or may reboot without doing a full CPU RESET.
If GIF is left cleared, the new kernel (or firmware) will be unabled to
awaken APs.  Eat faults on STGI (due to EFER.SVME=0) as it's possible
that SVM could be disabled via NMI shootdown between reading EFER.SVME
and executing STGI.

Link: https://lore.kernel.org/all/cbcb6f35-e5d7-c1c9-4db9-fe5cc4de579a@amd.com
Cc: stable@vger.kernel.org
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20221130233650.1404148-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/include/asm/virtext.h