File 0290-i386-Add-spec-ctrl-CPUID-bit.patch of Package qemu.10254
From 56bfdb185aba956f5227de64a7fd5cc617593a4f Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Tue, 9 Jan 2018 13:45:15 -0200
Subject: [PATCH] i386: Add spec-ctrl CPUID bit
Add the feature name and a CPUID_7_0_EDX_SPEC_CTRL macro.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20180109154519.25634-4-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit a2381f0934432ef2cd47a335348ba8839632164c)
[BR: BSC#1068032 CVE-2017-5715 modify to match current code's feat_name
type]
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
target-i386/cpu.c | 2 +-
target-i386/cpu.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index cd3b6726e6..c60b7bd95f 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -269,7 +269,7 @@ static const char *cpuid_7_0_edx_feature_name[] = {
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, "spec-ctrl", NULL,
NULL, NULL, NULL, NULL,
};
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 99981d98b0..b4a850befe 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -574,6 +574,8 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
#define CPUID_7_0_EBX_AVX512ER (1U << 27) /* AVX-512 Exponential and Reciprocal */
#define CPUID_7_0_EBX_AVX512CD (1U << 28) /* AVX-512 Conflict Detection */
+#define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */
+
#define CPUID_XSAVE_XSAVEOPT (1U << 0)
#define CPUID_XSAVE_XSAVEC (1U << 1)
#define CPUID_XSAVE_XGETBV1 (1U << 2)