summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorChao Peng2014-10-22 11:35:24 +0200
committerPaolo Bonzini2014-11-03 12:07:30 +0100
commit612263b30c900b534fa76609d314ed55c255a94e (patch)
tree1606193c7c9f6939c8f291a5b41edcb2e79e5540 /arch/x86/kvm/x86.c
parentkvm: drop unsupported capabilities, fix documentation (diff)
downloadkernel-qcow2-linux-612263b30c900b534fa76609d314ed55c255a94e.tar.gz
kernel-qcow2-linux-612263b30c900b534fa76609d314ed55c255a94e.tar.xz
kernel-qcow2-linux-612263b30c900b534fa76609d314ed55c255a94e.zip
KVM: x86: Enable Intel AVX-512 for guest
Expose Intel AVX-512 feature bits to guest. Also add checks for xcr0 AVX512 related bits according to spec: http://download-software.intel.com/sites/default/files/managed/71/2e/319433-017.pdf Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7a9cb56407bd..14c49cf3f77f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -666,6 +666,12 @@ int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
if ((!(xcr0 & XSTATE_BNDREGS)) != (!(xcr0 & XSTATE_BNDCSR)))
return 1;
+ if (xcr0 & XSTATE_AVX512) {
+ if (!(xcr0 & XSTATE_YMM))
+ return 1;
+ if ((xcr0 & XSTATE_AVX512) != XSTATE_AVX512)
+ return 1;
+ }
kvm_put_guest_xcr0(vcpu);
vcpu->arch.xcr0 = xcr0;