From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35785 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHcdg-0003Q9-Ke for qemu-devel@nongnu.org; Thu, 27 May 2010 08:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHcdM-0000u6-LB for qemu-devel@nongnu.org; Thu, 27 May 2010 08:56:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50558) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHcdM-0000u0-Ei for qemu-devel@nongnu.org; Thu, 27 May 2010 08:56:24 -0400 Message-ID: <4BFE6BF1.90501@redhat.com> Date: Thu, 27 May 2010 15:56:17 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1274953806-5316-1-git-send-email-sheng@linux.intel.com> In-Reply-To: <1274953806-5316-1-git-send-email-sheng@linux.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] qemu: Enable XSAVE related CPUID List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sheng Yang Cc: Marcelo Tosatti , kvm@vger.kernel.org, qemu-devel@nongnu.org On 05/27/2010 12:50 PM, Sheng Yang wrote: > We can support it in KVM now. The initial values are the minimal requirement > of XSAVE capable processor. > > Signed-off-by: Sheng Yang > --- > target-i386/cpuid.c | 32 ++++++++++++++++++++++++++++++++ > 1 files changed, 32 insertions(+), 0 deletions(-) > > diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c > index eebf038..cbf5595 100644 > --- a/target-i386/cpuid.c > +++ b/target-i386/cpuid.c > @@ -1067,6 +1067,38 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, > *ecx = 0; > *edx = 0; > break; > + case 0xD: > + /* Processor Extended State */ > + if (!(env->cpuid_ext_features& CPUID_EXT_XSAVE)) { > + *eax = 0; > + *ebx = 0; > + *ecx = 0; > + *edx = 0; > + break; > + } > + if (count == 0) { > + *eax = 0x7; /* FP | SSE | YMM */ > + *ebx = 0x340; /* FP + SSE + YMM size */ > + *ecx = 0x340; /* FP + SSE + YMM size */ > For -cpu host, we should pick these from KVM_GET_SUPPORTED_CPUID. For canned cpu types (e.g. qemu64), we need to return what we always did. We can also add a new cpu type that has them built in (there's no cpu on the market with avx, right?) > + *edx = 0; > + } else if (count == 1) { > + /* eax = 1, so we can continue with others */ > + *eax = 1; > + *ebx = 0; > + *ecx = 0; > + *edx = 0; > + } else if (count == 2) { > + *eax = 0x100; /* YMM size */ > + *ebx = 0x240; /* YMM offset */ > + *ecx = 0; > + *edx = 0; > These, too. > + } else { > + *eax = 0; > + *ebx = 0; > + *ecx = 0; > + *edx = 0; > + } > + break; > case 0x80000000: > *eax = env->cpuid_xlevel; > *ebx = env->cpuid_vendor1; > -- error compiling committee.c: too many arguments to function