From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] QEMU: Fix KVM XSAVE feature bit enumeration Date: Fri, 10 Jun 2011 15:31:21 +0200 Message-ID: <4DF21CA9.4030904@siemens.com> References: <1307707690-4861-1-git-send-email-andre.przywara@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: anthony@codemonkey.ws, avi@redhat.com, kvm@vger.kernel.org, Frank Arnold To: Andre Przywara Return-path: Received: from thoth.sbs.de ([192.35.17.2]:27784 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756407Ab1FJNba (ORCPT ); Fri, 10 Jun 2011 09:31:30 -0400 In-Reply-To: <1307707690-4861-1-git-send-email-andre.przywara@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 > --- > 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