thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-x86-cpu-Enable-new-SSE-AVX-AVX512-cpu-features.patch

9ae3a8
From 1d9d6bd6721a92ae161bd7a4e9de202691b90da0 Mon Sep 17 00:00:00 2001
9ae3a8
From: "plai@redhat.com" <plai@redhat.com>
9ae3a8
Date: Tue, 8 May 2018 17:40:48 +0200
9ae3a8
Subject: [PATCH 01/17] x86/cpu: Enable new SSE/AVX/AVX512 cpu features
9ae3a8
9ae3a8
RH-Author: plai@redhat.com
9ae3a8
Message-id: <1525801248-24104-1-git-send-email-plai@redhat.com>
9ae3a8
Patchwork-id: 80114
9ae3a8
O-Subject: [RHEL7.6 PATCH BZ 1513686] x86/cpu: Enable new SSE/AVX/AVX512 cpu features
9ae3a8
Bugzilla: 1513686
9ae3a8
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
9ae3a8
RH-Acked-by: Radim Krcmar <rkrcmar@redhat.com>
9ae3a8
9ae3a8
From: Yang Zhong <yang.zhong@intel.com>
9ae3a8
9ae3a8
Intel OTC Virt tested.
9ae3a8
9ae3a8
Intel IceLake cpu has added new cpu features,AVX512_VBMI2/GFNI/
9ae3a8
VAES/VPCLMULQDQ/AVX512_VNNI/AVX512_BITALG. Those new cpu features
9ae3a8
need expose to guest VM.
9ae3a8
9ae3a8
The bit definition:
9ae3a8
CPUID.(EAX=7,ECX=0):ECX[bit 06] AVX512_VBMI2
9ae3a8
CPUID.(EAX=7,ECX=0):ECX[bit 08] GFNI
9ae3a8
CPUID.(EAX=7,ECX=0):ECX[bit 09] VAES
9ae3a8
CPUID.(EAX=7,ECX=0):ECX[bit 10] VPCLMULQDQ
9ae3a8
CPUID.(EAX=7,ECX=0):ECX[bit 11] AVX512_VNNI
9ae3a8
CPUID.(EAX=7,ECX=0):ECX[bit 12] AVX512_BITALG
9ae3a8
9ae3a8
The release document ref below link:
9ae3a8
https://software.intel.com/sites/default/files/managed/c5/15/\
9ae3a8
architecture-instruction-set-extensions-programming-reference.pdf
9ae3a8
9ae3a8
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
9ae3a8
Message-Id: <1511335676-20797-1-git-send-email-yang.zhong@intel.com>
9ae3a8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
(cherry picked from commit aff9e6e46a343e1404498be4edd03db1112f0950)
9ae3a8
Signed-off-by: Paul Lai <plai@redhat.com>
9ae3a8
9ae3a8
Resolved Conflicts:
9ae3a8
        target/i386/cpu.c
9ae3a8
        target/i386/cpu.h
9ae3a8
                changes applied to target-i386/cpu.{c,h}
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 target-i386/cpu.c | 6 +++---
9ae3a8
 target-i386/cpu.h | 6 ++++++
9ae3a8
 2 files changed, 9 insertions(+), 3 deletions(-)
9ae3a8
9ae3a8
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
9ae3a8
index 539c202..48a5507 100644
9ae3a8
--- a/target-i386/cpu.c
9ae3a8
+++ b/target-i386/cpu.c
9ae3a8
@@ -156,9 +156,9 @@ static const char *cpuid_7_0_ebx_feature_name[] = {
9ae3a8
 
9ae3a8
 static const char *cpuid_7_0_ecx_feature_name[] = {
9ae3a8
     NULL, "avx512vbmi", NULL, "pku",
9ae3a8
-    "ospke", NULL, NULL, NULL,
9ae3a8
-    NULL, NULL, NULL, NULL,
9ae3a8
-    NULL, NULL, "avx512-vpopcntdq", NULL,
9ae3a8
+    "ospke", NULL, "avx512vbmi2", NULL,
9ae3a8
+    "gfni", "vaes", "vpclmulqdq", "avx512vnni",
9ae3a8
+    "avx512bitalg", NULL, "avx512-vpopcntdq", 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 da84443..a781639 100644
9ae3a8
--- a/target-i386/cpu.h
9ae3a8
+++ b/target-i386/cpu.h
9ae3a8
@@ -584,6 +584,12 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
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_VBMI2    (1U << 6) /* Additional VBMI Instrs */
9ae3a8
+#define CPUID_7_0_ECX_GFNI     (1U << 8)
9ae3a8
+#define CPUID_7_0_ECX_VAES     (1U << 9)
9ae3a8
+#define CPUID_7_0_ECX_VPCLMULQDQ (1U << 10)
9ae3a8
+#define CPUID_7_0_ECX_AVX512VNNI (1U << 11)
9ae3a8
+#define CPUID_7_0_ECX_AVX512BITALG (1U << 12)
9ae3a8
 #define CPUID_7_0_ECX_AVX512_VPOPCNTDQ (1U << 14) /* POPCNT for vectors of DW/QW */
9ae3a8
 #define CPUID_7_0_ECX_RDPID    (1U << 22)
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8