From patchwork Tue Jun 1 02:39:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 103351 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 o512eKdA004146 for ; Tue, 1 Jun 2010 02:40:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753410Ab0FACkQ (ORCPT ); Mon, 31 May 2010 22:40:16 -0400 Received: from mga09.intel.com ([134.134.136.24]:25465 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753232Ab0FACkP (ORCPT ); Mon, 31 May 2010 22:40:15 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 31 May 2010 19:37:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,337,1272870000"; d="scan'208";a="522780630" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.64]) by orsmga002.jf.intel.com with ESMTP; 31 May 2010 19:39:24 -0700 Received: from yasker by syang10-desktop with local (Exim 4.71) (envelope-from ) id 1OJHON-0000L3-BW; Tue, 01 Jun 2010 10:39:47 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: Anthony Liguori , kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 2/2] qemu: Enable XSAVE related CPUID Date: Tue, 1 Jun 2010 10:39:45 +0800 Message-Id: <1275359985-1273-2-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1275359985-1273-1-git-send-email-sheng@linux.intel.com> References: <1275359985-1273-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]); Tue, 01 Jun 2010 02:40:21 +0000 (UTC) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index eebf038..ec47950 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;