From patchwork Wed May 19 08:34:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 100803 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 o4J8bjB0021308 for ; Wed, 19 May 2010 08:37:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752865Ab0ESIhn (ORCPT ); Wed, 19 May 2010 04:37:43 -0400 Received: from mga02.intel.com ([134.134.136.20]:35504 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518Ab0ESIhm (ORCPT ); Wed, 19 May 2010 04:37:42 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 19 May 2010 01:34:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,262,1272870000"; d="scan'208";a="622921543" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.64]) by orsmga001.jf.intel.com with ESMTP; 19 May 2010 01:37:22 -0700 Received: from yasker by syang10-desktop with local (Exim 4.71) (envelope-from ) id 1OEeju-0003C2-9w; Wed, 19 May 2010 16:34:54 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, Sheng Yang Subject: [PATCH] qemu-kvm: Enable xsave related CPUID Date: Wed, 19 May 2010 16:34:50 +0800 Message-Id: <1274258090-12247-2-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1274258090-12247-1-git-send-email-sheng@linux.intel.com> References: <1274258090-12247-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]); Wed, 19 May 2010 08:37:46 +0000 (UTC) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index eebf038..21e94f3 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; + *ebx = 0x340; + *ecx = 0x340; + *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; + *ebx = 0x240; + *ecx = 0; + *edx = 0; + } else { + *eax = 0; + *ebx = 0; + *ecx = 0; + *edx = 0; + } + break; case 0x80000000: *eax = env->cpuid_xlevel; *ebx = env->cpuid_vendor1;