[PATCH] QEMU: Fix KVM XSAVE feature bit enumeration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When iterating through the XSAVE feature enumeration CPUID leaf (0xD)
we should not stop at the first zero EAX, but instead keep scanning
since there are gaps in the enumeration (ECX=1 for instance).
This fixes the proper usage of AVX in KVM guests.

Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>
---
 target-i386/kvm.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index faedc6c..4a97f78 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -448,6 +448,8 @@ int kvm_arch_init_vcpu(CPUState *env)
         case 0xb:
         case 0xd:
             for (j = 0; ; j++) {
+                if (i == 0xd && j == 64)
+                    break;
                 c->function = i;
                 c->flags = KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
                 c->index = j;
@@ -460,7 +462,7 @@ int kvm_arch_init_vcpu(CPUState *env)
                     break;
                 }
                 if (i == 0xd && c->eax == 0) {
-                    break;
+                    continue;
                 }
                 c = &cpuid_data.entries[cpuid_i++];
             }
-- 
1.6.4


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux