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

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