summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/zhaoxin.c
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-06-08 10:41:34 -0700
committerBorislav Petkov <bp@suse.de>2020-06-15 14:18:37 +0200
commit5d5103595e9e53048bb7e70ee2673c897ab38300 (patch)
tree733c865296305bee65d1f418f2a4816ead780237 /arch/x86/kernel/cpu/zhaoxin.c
parent8e742aa79780b13cd300a42198c1a4cea9c89905 (diff)
downloadlinux-5d5103595e9e53048bb7e70ee2673c897ab38300.tar.gz
linux-5d5103595e9e53048bb7e70ee2673c897ab38300.tar.bz2
linux-5d5103595e9e53048bb7e70ee2673c897ab38300.zip
x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup
Reinitialize IA32_FEAT_CTL on the BSP during wakeup to handle the case where firmware doesn't initialize or save/restore across S3. This fixes a bug where IA32_FEAT_CTL is left uninitialized and results in VMXON taking a #GP due to VMX not being fully enabled, i.e. breaks KVM. Use init_ia32_feat_ctl() to "restore" IA32_FEAT_CTL as it already deals with the case where the MSR is locked, and because APs already redo init_ia32_feat_ctl() during suspend by virtue of the SMP boot flow being used to reinitialize APs upon wakeup. Do the call in the early wakeup flow to avoid dependencies in the syscore_ops chain, e.g. simply adding a resume hook is not guaranteed to work, as KVM does VMXON in its own resume hook, kvm_resume(), when KVM has active guests. Fixes: 21bd3467a58e ("KVM: VMX: Drop initialization of IA32_FEAT_CTL MSR") Reported-by: Brad Campbell <lists2009@fnarfbargle.com> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Liam Merwick <liam.merwick@oracle.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Tested-by: Brad Campbell <lists2009@fnarfbargle.com> Cc: stable@vger.kernel.org # v5.6 Link: https://lkml.kernel.org/r/20200608174134.11157-1-sean.j.christopherson@intel.com
Diffstat (limited to 'arch/x86/kernel/cpu/zhaoxin.c')
-rw-r--r--arch/x86/kernel/cpu/zhaoxin.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/zhaoxin.c b/arch/x86/kernel/cpu/zhaoxin.c
index df1358ba622b..05fa4ef63490 100644
--- a/arch/x86/kernel/cpu/zhaoxin.c
+++ b/arch/x86/kernel/cpu/zhaoxin.c
@@ -2,6 +2,7 @@
#include <linux/sched.h>
#include <linux/sched/clock.h>
+#include <asm/cpu.h>
#include <asm/cpufeature.h>
#include "cpu.h"