From patchwork Thu Jun 17 07:18:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 106623 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 o5H7IMKk019279 for ; Thu, 17 Jun 2010 07:18:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754877Ab0FQHSI (ORCPT ); Thu, 17 Jun 2010 03:18:08 -0400 Received: from mga09.intel.com ([134.134.136.24]:61012 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753672Ab0FQHSF (ORCPT ); Thu, 17 Jun 2010 03:18:05 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 17 Jun 2010 00:18:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,430,1272870000"; d="scan'208";a="527705336" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.189]) by orsmga002.jf.intel.com with ESMTP; 17 Jun 2010 00:18:01 -0700 Received: from yasker by syang10-desktop with local (Exim 4.71) (envelope-from ) id 1OP9Mg-0007Zy-CE; Thu, 17 Jun 2010 15:18:18 +0800 From: Sheng Yang To: Marcelo Tosatti , Avi Kivity Cc: Jan Kiszka , Anthony Liguori , kvm@vger.kernel.org, qemu-devel@nongnu.org, Sheng Yang Subject: [PATCH 2/4] qemu: Enable XSAVE related CPUID Date: Thu, 17 Jun 2010 15:18:14 +0800 Message-Id: <1276759096-29104-3-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1276759096-29104-1-git-send-email-sheng@linux.intel.com> References: <1276759096-29104-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, 17 Jun 2010 07:18:24 +0000 (UTC) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 99d1f44..ab6536b 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -1067,6 +1067,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;