From patchwork Fri Nov 4 08:29:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luwei Kang X-Patchwork-Id: 9412075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 27E186022E for ; Fri, 4 Nov 2016 08:33:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CCBC2B0C0 for ; Fri, 4 Nov 2016 08:33:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 103A02B0CA; Fri, 4 Nov 2016 08:33:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A32132B0C0 for ; Fri, 4 Nov 2016 08:33:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2Ztn-0002hK-Vg; Fri, 04 Nov 2016 08:30:55 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2Ztm-0002hE-PQ for xen-devel@lists.xen.org; Fri, 04 Nov 2016 08:30:54 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id 37/C0-21400-D374C185; Fri, 04 Nov 2016 08:30:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRWlGSWpSXmKPExsXS1tYhr2vlLhN h0N+pZrHk42IWB0aPo7t/MwUwRrFm5iXlVySwZqzrfclUsJazYvGpzcwNjM/Yuxg5OYQEKiU2 fOoBsyUEeCWOLJvBCmH7SbydepcFoqZKovlEGxOIzSagLrH1/UawGhEBaYlrny8zgtjMAuEST U8nAcU5OIQFbCU2XJcDCbMIqEr8bt/PBBLmFXCROLLDBGK6nMTNc53MExi5FzAyrGLUKE4tKk st0jU00EsqykzPKMlNzMwB8kz1clOLixPTU3MSk4r1kvNzNzECPcsABDsY10x1PsQoycGkJMp 72l4mQogvKT+lMiOxOCO+qDQntfgQowwHh5IE7zRXoJxgUWp6akVaZg4wxGDSEhw8SiK8E0HS vMUFibnFmekQqVOMilLivJkgCQGQREZpHlwbLKwvMcpKCfMyAh0ixFOQWpSbWYIq/4pRnINRS Zj3PsgUnsy8Erjpr4AWMwEtNk+SAFlckoiQkmpgbA0/qNy30O2D6p3oKVoulU/ydlSwCyca1n jF+V5ZFPvfwDXneLbN5mPapxdt+a+VPX1dzvIvZnM7p9TzHw1UV98z3eiviFpb9LZS7dUHSm4 c0j/tdHKfUvOc39vFdVPvJSx0cTbZZmL1S/nrSl1bPSHusHuXr1a+mSFvk2JZs+Dr+0ANXWtl JZbijERDLeai4kQAV7uLEmYCAAA= X-Env-Sender: luwei.kang@intel.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1478248248!56391021!1 X-Originating-IP: [134.134.136.31] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10267 invoked from network); 4 Nov 2016 08:30:50 -0000 Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by server-11.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 4 Nov 2016 08:30:50 -0000 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 04 Nov 2016 01:30:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,442,1473145200"; d="scan'208";a="27386945" Received: from vmm-dell.bj.intel.com ([10.238.154.151]) by fmsmga005.fm.intel.com with ESMTP; 04 Nov 2016 01:30:41 -0700 From: Luwei Kang To: xen-devel@lists.xen.org Date: Fri, 4 Nov 2016 16:29:18 +0800 Message-Id: <1478248158-29112-1-git-send-email-luwei.kang@intel.com> X-Mailer: git-send-email 2.7.4 Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, Luwei Kang Subject: [Xen-devel] [PATCH] tools/libxc: Add xstate cpuid leaf of avx512 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Enable get xstate cpuid leaf information regarding avx512 in guest. Signed-off-by: Luwei Kang Reviewed-by: Andrew Cooper --- tools/libxc/xc_cpuid_x86.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index de06b32..d761805 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -406,6 +406,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch, #define X86_XCR0_AVX (1ULL << 2) #define X86_XCR0_BNDREG (1ULL << 3) #define X86_XCR0_BNDCSR (1ULL << 4) +#define X86_XCR0_OPMASK (1ULL << 5) +#define X86_XCR0_ZMM (1ULL << 6) +#define X86_XCR0_HI_ZMM (1ULL << 7) #define X86_XCR0_PKRU (1ULL << 9) #define X86_XCR0_LWP (1ULL << 62) @@ -437,6 +440,9 @@ static void xc_cpuid_config_xsave(xc_interface *xch, if ( test_bit(X86_FEATURE_MPX, info->featureset) ) guest_xfeature_mask |= X86_XCR0_BNDREG | X86_XCR0_BNDCSR; + if ( test_bit(X86_FEATURE_AVX512F, info->featureset) ) + guest_xfeature_mask |= X86_XCR0_OPMASK | X86_XCR0_ZMM | X86_XCR0_HI_ZMM; + if ( test_bit(X86_FEATURE_PKU, info->featureset) ) guest_xfeature_mask |= X86_XCR0_PKRU;