* [PATCH] QEMU: Fix KVM XSAVE feature bit enumeration
@ 2011-06-10 12:08 Andre Przywara
2011-06-10 13:31 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Andre Przywara @ 2011-06-10 12:08 UTC (permalink / raw)
To: anthony; +Cc: avi, kvm, Frank Arnold, 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 <andre.przywara@amd.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] QEMU: Fix KVM XSAVE feature bit enumeration
2011-06-10 12:08 [PATCH] QEMU: Fix KVM XSAVE feature bit enumeration Andre Przywara
@ 2011-06-10 13:31 ` Jan Kiszka
2011-06-10 13:56 ` [PATCH] KVM: Fix " Andre Przywara
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2011-06-10 13:31 UTC (permalink / raw)
To: Andre Przywara; +Cc: anthony, avi, kvm, Frank Arnold
On 2011-06-10 14:08, Andre Przywara wrote:
> 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@amd.com>
> ---
> 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;
checkpatch.pl?
> 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++];
> }
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] KVM: Fix XSAVE feature bit enumeration
2011-06-10 13:31 ` Jan Kiszka
@ 2011-06-10 13:56 ` Andre Przywara
2011-06-19 13:29 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Andre Przywara @ 2011-06-10 13:56 UTC (permalink / raw)
To: jan.kiszka, anthony; +Cc: avi, kvm, Frank Arnold, 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 <andre.przywara@amd.com>
---
target-i386/kvm.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index faedc6c..37a972f 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -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++];
}
--
1.6.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: Fix XSAVE feature bit enumeration
2011-06-10 13:56 ` [PATCH] KVM: Fix " Andre Przywara
@ 2011-06-19 13:29 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2011-06-19 13:29 UTC (permalink / raw)
To: Andre Przywara; +Cc: jan.kiszka, anthony, kvm, Frank Arnold
On 06/10/2011 04:56 PM, Andre Przywara wrote:
> 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.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-06-19 13:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 12:08 [PATCH] QEMU: Fix KVM XSAVE feature bit enumeration Andre Przywara
2011-06-10 13:31 ` Jan Kiszka
2011-06-10 13:56 ` [PATCH] KVM: Fix " Andre Przywara
2011-06-19 13:29 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox