From patchwork Thu Jun 10 03:31:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 105265 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5A3Y979032255 for ; Thu, 10 Jun 2010 03:34:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756273Ab0FJDeG (ORCPT ); Wed, 9 Jun 2010 23:34:06 -0400 Received: from mga01.intel.com ([192.55.52.88]:46585 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753403Ab0FJDeF (ORCPT ); Wed, 9 Jun 2010 23:34:05 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 09 Jun 2010 20:29:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,395,1272870000"; d="scan'208";a="574996346" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.64]) by fmsmga002.fm.intel.com with ESMTP; 09 Jun 2010 20:32:46 -0700 Received: from yasker by syang10-desktop with local (Exim 4.71) (envelope-from ) id 1OMYTw-0007nd-JR; Thu, 10 Jun 2010 11:31:04 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti , Anthony Liguori Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, Sheng Yang Subject: [PATCH 2/3] qemu: Enable XSAVE related CPUID Date: Thu, 10 Jun 2010 11:31:02 +0800 Message-Id: <1276140663-29954-2-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1276140663-29954-1-git-send-email-sheng@linux.intel.com> References: <1276140663-29954-1-git-send-email-sheng@linux.intel.com> 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]); Thu, 10 Jun 2010 03:34:09 +0000 (UTC) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index fb78061..26e4054 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -1081,6 +1081,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;