]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: VMX: Move caching of MSR_IA32_XSS to hardware_setup()
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 3 Dec 2018 21:52:59 +0000 (13:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:47:14 +0000 (12:47 +0100)
[ Upstream commit 71d9409e20934e16f2d2ea88f0d1fb9851a7da3b ]

MSR_IA32_XSS has no relation to the VMCS whatsoever, it doesn't belong
in setup_vmcs_config() and its reference to host_xss prevents moving
setup_vmcs_config() to a dedicated file.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: a44b331614e6 ("KVM: x86/vmx: Do not skip segment attributes if unusable bit is set")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/vmx/vmx.c

index f8ad29968e85348e0b5d4d62895f139df71cce8d..5c4d2758b1d98b5882a0ce811fe4f8657cb1d101 100644 (file)
@@ -4740,9 +4740,6 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
                }
        }
 
-       if (boot_cpu_has(X86_FEATURE_XSAVES))
-               rdmsrl(MSR_IA32_XSS, host_xss);
-
        return 0;
 }
 
@@ -7957,6 +7954,9 @@ static __init int hardware_setup(void)
                WARN_ONCE(host_bndcfgs, "KVM: BNDCFGS in host will be lost");
        }
 
+       if (boot_cpu_has(X86_FEATURE_XSAVES))
+               rdmsrl(MSR_IA32_XSS, host_xss);
+
        if (!cpu_has_vmx_vpid() || !cpu_has_vmx_invvpid() ||
                !(cpu_has_vmx_invvpid_single() || cpu_has_vmx_invvpid_global()))
                enable_vpid = 0;