Pablo Greco e6a3ae
From 1e661277e83c9b2e29bf5e2e77f358355aa11c8a Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: "plai@redhat.com" <plai@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 3 Apr 2019 15:54:28 +0100
Pablo Greco e6a3ae
Subject: [PATCH 04/10] i386: Add CPUID bit for WBNOINVD
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: plai@redhat.com
Pablo Greco e6a3ae
Message-id: <1554306874-28796-5-git-send-email-plai@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 85382
Pablo Greco e6a3ae
O-Subject: [RHEL8.1 qemu-kvm PATCH resend 04/10] i386: Add CPUID bit for WBNOINVD
Pablo Greco e6a3ae
Bugzilla: 1561761
Pablo Greco e6a3ae
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: Robert Hoo <robert.hu@linux.intel.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
WBNOINVD: Write back and do not invalidate cache, enumerated by
Pablo Greco e6a3ae
CPUID.(EAX=80000008H, ECX=0):EBX[bit 9].
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Pablo Greco e6a3ae
Message-Id: <1530781798-183214-5-git-send-email-robert.hu@linux.intel.com>
Pablo Greco e6a3ae
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 59a80a19ca31a6fff9fdbb6b4cf55a5a0767c3bc)
Pablo Greco e6a3ae
Signed-off-by: Paul Lai <plai@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Resolved Conflicts:
Pablo Greco e6a3ae
	target/i386/cpu.h
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 target/i386/cpu.c | 2 +-
Pablo Greco e6a3ae
 target/i386/cpu.h | 2 ++
Pablo Greco e6a3ae
 2 files changed, 3 insertions(+), 1 deletion(-)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
Pablo Greco e6a3ae
index fec39bd..8b9a9f6 100644
Pablo Greco e6a3ae
--- a/target/i386/cpu.c
Pablo Greco e6a3ae
+++ b/target/i386/cpu.c
Pablo Greco e6a3ae
@@ -1036,7 +1036,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
Pablo Greco e6a3ae
         .feat_names = {
Pablo Greco e6a3ae
             NULL, NULL, NULL, NULL,
Pablo Greco e6a3ae
             NULL, NULL, NULL, NULL,
Pablo Greco e6a3ae
-            NULL, NULL, NULL, NULL,
Pablo Greco e6a3ae
+            NULL, "wbnoinvd", NULL, NULL,
Pablo Greco e6a3ae
             "ibpb", NULL, NULL, NULL,
Pablo Greco e6a3ae
             NULL, NULL, NULL, NULL,
Pablo Greco e6a3ae
             NULL, NULL, NULL, NULL,
Pablo Greco e6a3ae
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
Pablo Greco e6a3ae
index 3b2ea97..dd4493e 100644
Pablo Greco e6a3ae
--- a/target/i386/cpu.h
Pablo Greco e6a3ae
+++ b/target/i386/cpu.h
Pablo Greco e6a3ae
@@ -693,6 +693,8 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
 #define KVM_HINTS_DEDICATED (1U << 0)
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
+#define CPUID_8000_0008_EBX_WBNOINVD  (1U << 9)  /* Write back and
Pablo Greco e6a3ae
+                                                                             do not invalidate cache */
Pablo Greco e6a3ae
 #define CPUID_8000_0008_EBX_IBPB    (1U << 12) /* Indirect Branch Prediction Barrier */
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
 #define CPUID_XSAVE_XSAVEOPT   (1U << 0)
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae