yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-target-i386-Add-Intel-SHA_NI-instruction-support.patch

5d360b
From 481923b5c3cd124ba38ee34e803f15afae39c793 Mon Sep 17 00:00:00 2001
5d360b
From: Eduardo Habkost <ehabkost@redhat.com>
5d360b
Date: Thu, 5 Oct 2017 22:39:07 +0200
5d360b
Subject: [PATCH 24/27] target-i386: Add Intel SHA_NI instruction support.
5d360b
5d360b
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
5d360b
Message-id: <20171005223908.431-2-ehabkost@redhat.com>
5d360b
Patchwork-id: 76832
5d360b
O-Subject: [RHEL-7.5 qemu-kvm PATCH 1/2] target-i386: Add Intel SHA_NI instruction support.
5d360b
Bugzilla: 1450396
5d360b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
5d360b
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
5d360b
RH-Acked-by: Bandan Das <bsd@redhat.com>
5d360b
5d360b
From: Yi Sun <yi.y.sun@linux.intel.com>
5d360b
5d360b
Add SHA_NI feature bit. Its spec can be found at:
5d360b
https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf
5d360b
5d360b
Backport notes:
5d360b
* target/i386 is target-i386 in the QEMU 1.5.3 tree
5d360b
5d360b
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
5d360b
Message-Id: <1481683803-10051-1-git-send-email-yi.y.sun@linux.intel.com>
5d360b
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5d360b
(cherry picked from commit 638cbd452d3a92a2ab18caee73078483d90f64eb)
5d360b
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5d360b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
5d360b
---
5d360b
 target-i386/cpu.c | 2 +-
5d360b
 target-i386/cpu.h | 1 +
5d360b
 2 files changed, 2 insertions(+), 1 deletion(-)
5d360b
5d360b
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
5d360b
index fbd3117..e0749c0 100644
5d360b
--- a/target-i386/cpu.c
5d360b
+++ b/target-i386/cpu.c
5d360b
@@ -151,7 +151,7 @@ static const char *cpuid_7_0_ebx_feature_name[] = {
5d360b
     "avx512f", "avx512dq", "rdseed", "adx",
5d360b
     "smap", "avx512ifma", NULL, NULL,
5d360b
     NULL, NULL, "avx512pf", "avx512er",
5d360b
-    "avx512cd", NULL, "avx512bw", "avx512vl",
5d360b
+    "avx512cd", "sha-ni", "avx512bw", "avx512vl",
5d360b
 };
5d360b
 
5d360b
 static const char *cpuid_7_0_ecx_feature_name[] = {
5d360b
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
5d360b
index 7a12c0d..78b8072 100644
5d360b
--- a/target-i386/cpu.h
5d360b
+++ b/target-i386/cpu.h
5d360b
@@ -575,6 +575,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
5d360b
 #define CPUID_7_0_EBX_AVX512ER (1U << 27) /* AVX-512 Exponential and Reciprocal */
5d360b
 #define CPUID_7_0_EBX_AVX512CD (1U << 28) /* AVX-512 Conflict Detection */
5d360b
 #define CPUID_7_0_EBX_AVX512BW (1U << 30) /* AVX-512 Byte and Word Instructions */
5d360b
+#define CPUID_7_0_EBX_SHA_NI   (1U << 29) /* SHA1/SHA256 Instruction Extensions */
5d360b
 #define CPUID_7_0_EBX_AVX512VL (1U << 31) /* AVX-512 Vector Length Extensions */
5d360b
 
5d360b
 #define CPUID_7_0_ECX_VBMI     (1U << 1)  /* AVX-512 Vector Byte Manipulation Instrs */
5d360b
-- 
5d360b
1.8.3.1
5d360b