From patchwork Mon Jun 28 16:14:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 108390 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5SGFkKf025541 for ; Mon, 28 Jun 2010 16:15:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752988Ab0F1QPl (ORCPT ); Mon, 28 Jun 2010 12:15:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29386 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870Ab0F1QPk (ORCPT ); Mon, 28 Jun 2010 12:15:40 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFbi4026071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Jun 2010 12:15:37 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFbFW024439; Mon, 28 Jun 2010 12:15:37 -0400 Received: from amt.cnet (vpn2-11-80.ams2.redhat.com [10.36.11.80]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFYXs017378; Mon, 28 Jun 2010 12:15:35 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 6249968A894; Mon, 28 Jun 2010 13:14:39 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o5SGEamA007581; Mon, 28 Jun 2010 13:14:36 -0300 From: Marcelo Tosatti To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Sheng Yang , Marcelo Tosatti Subject: [PATCH 4/7] Enable XSAVE related CPUID Date: Mon, 28 Jun 2010 13:14:11 -0300 Message-Id: <51e49430c0472c9f609341e3058d47ed93dabe6e.1277741654.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 28 Jun 2010 16:15:46 +0000 (UTC) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index fe0e6b2..83057bd 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -1087,6 +1087,27 @@ 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 (kvm_enabled()) { + *eax = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EAX); + *ebx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EBX); + *ecx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_ECX); + *edx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EDX); + } else { + *eax = 0; + *ebx = 0; + *ecx = 0; + *edx = 0; + } + break; case 0x80000000: *eax = env->cpuid_xlevel; *ebx = env->cpuid_vendor1;