9ae3a8
From 73b0c0b62c08330e65e9ec3d54ae5738d4b5211d Mon Sep 17 00:00:00 2001
9ae3a8
From: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Date: Fri, 9 Sep 2016 19:08:34 +0200
9ae3a8
Subject: [PATCH 2/2] target-i386: Add more Intel AVX-512 instructions support
9ae3a8
9ae3a8
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Message-id: <1473448114-1430-3-git-send-email-ehabkost@redhat.com>
9ae3a8
Patchwork-id: 72277
9ae3a8
O-Subject: [RHEL-7.3 qemu-kvm PATCH v2 2/2] target-i386: Add more Intel AVX-512 instructions support
9ae3a8
Bugzilla: 1372459
9ae3a8
RH-Acked-by: Bandan Das <bsd@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
From: Luwei Kang <luwei.kang@intel.com>
9ae3a8
9ae3a8
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1372459
9ae3a8
9ae3a8
Add more AVX512 feature bits, include AVX512DQ, AVX512IFMA,
9ae3a8
AVX512BW, AVX512VL, AVX512VBMI. Its spec can be found at:
9ae3a8
https://software.intel.com/sites/default/files/managed/b4/3a/319433-024.pdf
9ae3a8
9ae3a8
Signed-off-by: Luwei Kang <luwei.kang@intel.com>
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
(cherry picked from commit cc728d1493eee3e20c1547191862e43d3f55e714)
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 target-i386/cpu.c | 14 +++++++++-----
9ae3a8
 target-i386/cpu.h | 13 +++++++++++++
9ae3a8
 2 files changed, 22 insertions(+), 5 deletions(-)
9ae3a8
9ae3a8
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
9ae3a8
index d9c214c..476306d 100644
9ae3a8
--- a/target-i386/cpu.c
9ae3a8
+++ b/target-i386/cpu.c
9ae3a8
@@ -144,14 +144,18 @@ static const char *svm_feature_name[] = {
9ae3a8
 };
9ae3a8
 
9ae3a8
 static const char *cpuid_7_0_ebx_feature_name[] = {
9ae3a8
-    "fsgsbase", NULL, NULL, "bmi1", "hle", "avx2", NULL, "smep",
9ae3a8
-    "bmi2", "erms", "invpcid", "rtm", NULL, NULL, "mpx", NULL,
9ae3a8
-    "avx512f", NULL, "rdseed", "adx", "smap", NULL, NULL, NULL,
9ae3a8
-    NULL, NULL, "avx512pf", "avx512er", "avx512cd", NULL, NULL, NULL,
9ae3a8
+    "fsgsbase", NULL, NULL, "bmi1",
9ae3a8
+    "hle", "avx2", NULL, "smep",
9ae3a8
+    "bmi2", "erms", "invpcid", "rtm",
9ae3a8
+    NULL, NULL, "mpx", NULL,
9ae3a8
+    "avx512f", "avx512dq", "rdseed", "adx",
9ae3a8
+    "smap", "avx512ifma", NULL, NULL,
9ae3a8
+    NULL, NULL, "avx512pf", "avx512er",
9ae3a8
+    "avx512cd", NULL, "avx512bw", "avx512vl",
9ae3a8
 };
9ae3a8
 
9ae3a8
 static const char *cpuid_7_0_ecx_feature_name[] = {
9ae3a8
-    NULL, NULL, NULL, NULL,
9ae3a8
+    NULL, "avx512vbmi", NULL, NULL,
9ae3a8
     NULL, NULL, NULL, NULL,
9ae3a8
     NULL, NULL, NULL, NULL,
9ae3a8
     NULL, NULL, NULL, NULL,
9ae3a8
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
9ae3a8
index 5c62ee3..d541809 100644
9ae3a8
--- a/target-i386/cpu.h
9ae3a8
+++ b/target-i386/cpu.h
9ae3a8
@@ -560,12 +560,25 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
9ae3a8
 #define CPUID_7_0_EBX_RTM      (1U << 11)
9ae3a8
 #define CPUID_7_0_EBX_MPX      (1U << 14)
9ae3a8
 #define CPUID_7_0_EBX_AVX512F  (1U << 16) /* AVX-512 Foundation */
9ae3a8
+#define CPUID_7_0_EBX_AVX512DQ (1U << 17) /* AVX-512 Doubleword & Quadword Instrs */
9ae3a8
 #define CPUID_7_0_EBX_RDSEED   (1U << 18)
9ae3a8
 #define CPUID_7_0_EBX_ADX      (1U << 19)
9ae3a8
 #define CPUID_7_0_EBX_SMAP     (1U << 20)
9ae3a8
+#define CPUID_7_0_EBX_AVX512IFMA (1U << 21) /* AVX-512 Integer Fused Multiply Add */
9ae3a8
+#define CPUID_7_0_EBX_PCOMMIT  (1U << 22) /* Persistent Commit */
9ae3a8
+#define CPUID_7_0_EBX_CLFLUSHOPT (1U << 23) /* Flush a Cache Line Optimized */
9ae3a8
+#define CPUID_7_0_EBX_CLWB     (1U << 24) /* Cache Line Write Back */
9ae3a8
 #define CPUID_7_0_EBX_AVX512PF (1U << 26) /* AVX-512 Prefetch */
9ae3a8
 #define CPUID_7_0_EBX_AVX512ER (1U << 27) /* AVX-512 Exponential and Reciprocal */
9ae3a8
 #define CPUID_7_0_EBX_AVX512CD (1U << 28) /* AVX-512 Conflict Detection */
9ae3a8
+#define CPUID_7_0_EBX_AVX512BW (1U << 30) /* AVX-512 Byte and Word Instructions */
9ae3a8
+#define CPUID_7_0_EBX_AVX512VL (1U << 31) /* AVX-512 Vector Length Extensions */
9ae3a8
+
9ae3a8
+#define CPUID_7_0_ECX_VBMI     (1U << 1)  /* AVX-512 Vector Byte Manipulation Instrs */
9ae3a8
+#define CPUID_7_0_ECX_UMIP     (1U << 2)
9ae3a8
+#define CPUID_7_0_ECX_PKU      (1U << 3)
9ae3a8
+#define CPUID_7_0_ECX_OSPKE    (1U << 4)
9ae3a8
+#define CPUID_7_0_ECX_RDPID    (1U << 22)
9ae3a8
 
9ae3a8
 #define CPUID_XSAVE_XSAVEOPT   (1U << 0)
9ae3a8
 #define CPUID_XSAVE_XSAVEC     (1U << 1)
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8