QEMU: Fix KVM XSAVE feature bit enumeration
PATCH 1/1 QEMU: Fix KVM XSAVE feature bit enumeration
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.
--- target-i386/kvm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
target-i386/kvm.c +3 -1
@@ -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++]; }
Signature · 1 line
1.6.4
Quoted 15 lines · Andre Przywara
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 <[email protected]>--- target-i386/kvm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)target-i386/kvm.c +0
-0
target-i386/kvm.c int kvm_arch_init_vcpu(CPUState *env) · line 452
Quoted 5 lines
target-i386/kvm.c +2
-0@@ -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 ;
checkpatch.pl?
target-i386/kvm.c int kvm_arch_init_vcpu(CPUState *env) · line 468
Quoted 12 lines
target-i386/kvm.c +1
-1c->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++]; }
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
PATCH 1/1 KVM: Fix XSAVE feature bit enumeration
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.
--- target-i386/kvm.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
target-i386/kvm.c +4 -1
@@ -448,6 +448,9 @@ 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 +463,7 @@ int kvm_arch_init_vcpu(CPUState *env)break ; }if (i ==0xd && c->eax ==0 ) { -break ; +continue ; } c = &cpuid_data.entries[cpuid_i++]; }
Signature · 1 line
1.6.4
Avi Kivity
AppliedRe: [PATCH] KVM: Fix XSAVE feature bit enumeration
Quoted 4 lines · Andre Przywara
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.
Thanks, applied to uq/master.
Signature · 1 line
error compiling committee.c: too many arguments to function