From nobody Wed May 1 16:23:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508233007894301.95433472202023; Tue, 17 Oct 2017 02:36:47 -0700 (PDT) Received: from localhost ([::1]:37385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4OIZ-00069H-5a for importer@patchew.org; Tue, 17 Oct 2017 05:36:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4OHO-0005Yj-E4 for qemu-devel@nongnu.org; Tue, 17 Oct 2017 05:35:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4OHJ-0006gl-AD for qemu-devel@nongnu.org; Tue, 17 Oct 2017 05:35:18 -0400 Received: from mga07.intel.com ([134.134.136.100]:48127) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e4OHJ-0006fb-1E for qemu-devel@nongnu.org; Tue, 17 Oct 2017 05:35:13 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 17 Oct 2017 02:35:10 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.49]) by FMSMGA003.fm.intel.com with ESMTP; 17 Oct 2017 02:35:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,390,1503385200"; d="scan'208";a="910667213" From: Yang Zhong To: qemu-devel@nongnu.org Date: Tue, 17 Oct 2017 17:34:43 +0800 Message-Id: <1508232883-8790-1-git-send-email-yang.zhong@intel.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.100 Subject: [Qemu-devel] [PATCH] x86/cpufeatures: Enable new AVX512 cpu features X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.zhong@intel.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Intel IceLake cpu has added new cpu features,AVX512VBMI2/GFNI/ VAES/AVX512VNNI/AVX512BITALG/VPCLMULQDQ. Those new cpu features need expose to guest VM. The bit definition: CPUID.(EAX=3D7,ECX=3D0):ECX[bit 06] AVX512VBMI2 CPUID.(EAX=3D7,ECX=3D0):ECX[bit 08] GFNI CPUID.(EAX=3D7,ECX=3D0):ECX[bit 09] VAES CPUID.(EAX=3D7,ECX=3D0):ECX[bit 10] VPCLMULQDQ CPUID.(EAX=3D7,ECX=3D0):ECX[bit 11] AVX512VNNI CPUID.(EAX=3D7,ECX=3D0):ECX[bit 12] AVX512_BITALG The release document ref below link: https://software.intel.com/sites/default/files/managed/c5/15/ architecture-instruction-set-extensions-programming-reference.pdf Signed-off-by: Yang Zhong --- target/i386/cpu.c | 6 +++--- target/i386/cpu.h | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 98732cd..03fb8ad 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -435,9 +435,9 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS]= =3D { [FEAT_7_0_ECX] =3D { .feat_names =3D { NULL, "avx512vbmi", "umip", "pku", - "ospke", NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL, "avx512-vpopcntdq", NULL, + "ospke", NULL, "avx512vbmi2", NULL, + "gfni", "vaes", "vpclmulqdq", "avx512vnni", + "avx512bitalg", NULL, "avx512-vpopcntdq", NULL, "la57", NULL, NULL, NULL, NULL, NULL, "rdpid", NULL, NULL, NULL, NULL, NULL, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index b086b15..cdbf8b0 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -635,6 +635,12 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_0_ECX_UMIP (1U << 2) #define CPUID_7_0_ECX_PKU (1U << 3) #define CPUID_7_0_ECX_OSPKE (1U << 4) +#define CPUID_7_0_ECX_VBMI2 (1U << 6) /* Additional VBMI Instrs */ +#define CPUID_7_0_ECX_GFNI (1U << 8) +#define CPUID_7_0_ECX_VAES (1U << 9) +#define CPUID_7_0_ECX_VPCLMULQDQ (1U << 10) +#define CPUID_7_0_ECX_AVX512VNNI (1U << 11) +#define CPUID_7_0_ECX_AVX512BITALG (1U << 12) #define CPUID_7_0_ECX_AVX512_VPOPCNTDQ (1U << 14) /* POPCNT for vectors of= DW/QW */ #define CPUID_7_0_ECX_LA57 (1U << 16) #define CPUID_7_0_ECX_RDPID (1U << 22) --=20 1.9.1