yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-i386-Add-CPUID-bit-and-feature-words-for-IA32_ARCH_C.patch

ae23c9
From 5765ff204771d519ec6c109a8f6b15871251dff0 Mon Sep 17 00:00:00 2001
ae23c9
From: "plai@redhat.com" <plai@redhat.com>
ae23c9
Date: Wed, 3 Apr 2019 15:54:26 +0100
ae23c9
Subject: [PATCH 02/10] i386: Add CPUID bit and feature words for
ae23c9
 IA32_ARCH_CAPABILITIES MSR
ae23c9
ae23c9
RH-Author: plai@redhat.com
ae23c9
Message-id: <1554306874-28796-3-git-send-email-plai@redhat.com>
ae23c9
Patchwork-id: 85386
ae23c9
O-Subject: [RHEL8.1 qemu-kvm PATCH resend 02/10] i386: Add CPUID bit and feature words for IA32_ARCH_CAPABILITIES MSR
ae23c9
Bugzilla: 1561761
ae23c9
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
ae23c9
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
ae23c9
ae23c9
From: Robert Hoo <robert.hu@linux.intel.com>
ae23c9
ae23c9
Support of IA32_PRED_CMD MSR already be enumerated by same CPUID bit as
ae23c9
SPEC_CTRL.
ae23c9
ae23c9
At present, mark CPUID_7_0_EDX_ARCH_CAPABILITIES unmigratable, per Paolo's
ae23c9
comment.
ae23c9
ae23c9
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
ae23c9
Message-Id: <1530781798-183214-3-git-send-email-robert.hu@linux.intel.com>
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
(cherry picked from commit 3fc7c73139d2d38ae80c3b0bc963b1ac1555924c)
ae23c9
Signed-off-by: Paul Lai <plai@redhat.com>
ae23c9
ae23c9
Resolved Conflicts:
ae23c9
	target/i386/cpu.c
ae23c9
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 target/i386/cpu.c | 3 ++-
ae23c9
 target/i386/cpu.h | 1 +
ae23c9
 2 files changed, 3 insertions(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
ae23c9
index c979feb..6d38ac0 100644
ae23c9
--- a/target/i386/cpu.c
ae23c9
+++ b/target/i386/cpu.c
ae23c9
@@ -1008,12 +1008,13 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
ae23c9
             NULL, NULL, NULL, NULL,
ae23c9
             NULL, NULL, NULL, NULL,
ae23c9
             NULL, NULL, "spec-ctrl", "stibp",
ae23c9
-            NULL, NULL, NULL, "ssbd",
ae23c9
+            NULL, "arch-capabilities", NULL, "ssbd",
ae23c9
         },
ae23c9
         .cpuid_eax = 7,
ae23c9
         .cpuid_needs_ecx = true, .cpuid_ecx = 0,
ae23c9
         .cpuid_reg = R_EDX,
ae23c9
         .tcg_features = TCG_7_0_EDX_FEATURES,
ae23c9
+        .unmigratable_flags = CPUID_7_0_EDX_ARCH_CAPABILITIES,
ae23c9
     },
ae23c9
     [FEAT_8000_0007_EDX] = {
ae23c9
         .feat_names = {
ae23c9
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
ae23c9
index 1dc565c..e5e5169 100644
ae23c9
--- a/target/i386/cpu.h
ae23c9
+++ b/target/i386/cpu.h
ae23c9
@@ -687,6 +687,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
ae23c9
 #define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */
ae23c9
 #define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */
ae23c9
 #define CPUID_7_0_EDX_SPEC_CTRL     (1U << 26) /* Speculation Control */
ae23c9
+#define CPUID_7_0_EDX_ARCH_CAPABILITIES (1U << 29)  /*Arch Capabilities*/
ae23c9
 #define CPUID_7_0_EDX_SPEC_CTRL_SSBD  (1U << 31) /* Speculative Store Bypass Disable */
ae23c9
 
ae23c9
 #define KVM_HINTS_DEDICATED (1U << 0)
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9