Blame SOURCES/kvm-x86-cpu-Enable-CLDEMOTE-Demote-Cache-Line-cpu-featur.patch

7711c0
From 45be760eda02e18ac33b603224a47b3954bfb762 Mon Sep 17 00:00:00 2001
7711c0
From: "plai@redhat.com" <plai@redhat.com>
7711c0
Date: Mon, 4 Feb 2019 17:31:05 +0100
7711c0
Subject: [PATCH 01/12] x86/cpu: Enable CLDEMOTE(Demote Cache Line) cpu feature
7711c0
7711c0
RH-Author: plai@redhat.com
7711c0
Message-id: <1549301465-19852-1-git-send-email-plai@redhat.com>
7711c0
Patchwork-id: 84206
7711c0
O-Subject: [RHEL7.7 qemu-kvm-rhev PATCH BZ 1537776 RESEND] x86/cpu: Enable CLDEMOTE(Demote Cache Line) cpu feature
7711c0
Bugzilla: 1537776
7711c0
RH-Acked-by: Bandan Das <bsd@redhat.com>
7711c0
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
7711c0
RH-Acked-by: John Snow <jsnow@redhat.com>
7711c0
7711c0
The CLDEMOTE instruction hints to hardware that the cache line that
7711c0
contains the linear address should be moved("demoted") from
7711c0
the cache(s) closest to the processor core to a level more distant
7711c0
from the processor core. This may accelerate subsequent accesses
7711c0
to the line by other cores in the same coherence domain,
7711c0
especially if the line was written by the core that demotes the line.
7711c0
7711c0
Intel Snow Ridge has added new cpu feature, CLDEMOTE.
7711c0
The new cpu feature needs to be exposed to guest VM.
7711c0
7711c0
The bit definition:
7711c0
CPUID.(EAX=7,ECX=0):ECX[bit 25] CLDEMOTE
7711c0
7711c0
The release document ref below link:
7711c0
https://software.intel.com/sites/default/files/managed/c5/15/\
7711c0
architecture-instruction-set-extensions-programming-reference.pdf
7711c0
7711c0
Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
7711c0
Message-Id: <1525406253-54846-1-git-send-email-jingqi.liu@intel.com>
7711c0
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
7711c0
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7711c0
(cherry picked from commit 0da0fb062841d0dcd8ba47e4a989d2e952cdf0ff)
7711c0
Signed-off-by: Paul Lai <plai@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 target/i386/cpu.c | 2 +-
7711c0
 target/i386/cpu.h | 1 +
7711c0
 2 files changed, 2 insertions(+), 1 deletion(-)
7711c0
7711c0
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
7711c0
index c5156c8..4558b1a 100644
7711c0
--- a/target/i386/cpu.c
7711c0
+++ b/target/i386/cpu.c
7711c0
@@ -991,7 +991,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
7711c0
             "avx512bitalg", NULL, "avx512-vpopcntdq", NULL,
7711c0
             "la57", NULL, NULL, NULL,
7711c0
             NULL, NULL, "rdpid", NULL,
7711c0
-            NULL, NULL, NULL, NULL,
7711c0
+            NULL, "cldemote", NULL, NULL,
7711c0
             NULL, NULL, NULL, NULL,
7711c0
         },
7711c0
         .cpuid_eax = 7,
7711c0
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
7711c0
index 392065d..ea8c355 100644
7711c0
--- a/target/i386/cpu.h
7711c0
+++ b/target/i386/cpu.h
7711c0
@@ -682,6 +682,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
7711c0
 #define CPUID_7_0_ECX_AVX512_VPOPCNTDQ (1U << 14) /* POPCNT for vectors of DW/QW */
7711c0
 #define CPUID_7_0_ECX_LA57     (1U << 16)
7711c0
 #define CPUID_7_0_ECX_RDPID    (1U << 22)
7711c0
+#define CPUID_7_0_ECX_CLDEMOTE (1U << 25)  /* CLDEMOTE Instruction */
7711c0
 
7711c0
 #define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */
7711c0
 #define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */
7711c0
-- 
7711c0
1.8.3.1
7711c0