]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - arch/x86/kvm/svm.c
KVM: x86: Drop special XSAVE handling from guest_cpuid_has()
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 10 Dec 2019 22:44:15 +0000 (14:44 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 21 Jan 2020 12:58:10 +0000 (13:58 +0100)
commit96be4e069c938e4a5fc7125de7e1cc7089b1adef
tree954b6bced81f4878ee3412394684286b0361006e
parentf1cdecf5807b1a91829a2dc4f254bfe6bafd4776
KVM: x86: Drop special XSAVE handling from guest_cpuid_has()

Now that KVM prevents setting host-reserved CR4 bits, drop the dedicated
XSAVE check in guest_cpuid_has() in favor of open coding similar checks
in the SVM/VMX XSAVES enabling flows.

Note, checking boot_cpu_has(X86_FEATURE_XSAVE) in the XSAVES flows is
technically redundant with respect to the CR4 reserved bit checks, e.g.
XSAVES #UDs if CR4.OSXSAVE=0 and arch.xsaves_enabled is consumed if and
only if CR4.OXSAVE=1 in guest.  Keep (add?) the explicit boot_cpu_has()
checks to help document KVM's usage of arch.xsaves_enabled.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.h
arch/x86/kvm/svm.c
arch/x86/kvm/vmx/vmx.c