Blame SOURCES/kvm-i386-Disable-OSPKE-on-CPU-model-definitions-NEW.patch

b38b0f
From 04f34e7c0b0fada186ca7012f5f4168f46483c5f Mon Sep 17 00:00:00 2001
b38b0f
From: "plai@redhat.com" <plai@redhat.com>
b38b0f
Date: Mon, 1 Jul 2019 16:17:34 +0100
b38b0f
Subject: [PATCH 05/39] i386: Disable OSPKE on CPU model definitions
b38b0f
b38b0f
RH-Author: plai@redhat.com
b38b0f
Message-id: <1561997854-9646-6-git-send-email-plai@redhat.com>
b38b0f
Patchwork-id: 89334
b38b0f
O-Subject: [RHEL8.1 qemu-kvm PATCH v6 5/5] i386: Disable OSPKE on CPU model definitions
b38b0f
Bugzilla: 1629906
b38b0f
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
b38b0f
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
b38b0f
RH-Acked-by: Bandan Das <bsd@redhat.com>
b38b0f
b38b0f
From: Eduardo Habkost <ehabkost@redhat.com>
b38b0f
b38b0f
Currently, the Cascadelake-Server, Icelake-Client, and
b38b0f
Icelake-Server are always generating the following warning:
b38b0f
b38b0f
  qemu-system-x86_64: warning: \
b38b0f
    host doesn't support requested feature: CPUID.07H:ECX [bit 4]
b38b0f
b38b0f
This happens because OSPKE was never returned by
b38b0f
GET_SUPPORTED_CPUID or x86_cpu_get_supported_feature_word().
b38b0f
OSPKE is a runtime flag automatically set by the KVM module or by
b38b0f
TCG code, was always cleared by x86_cpu_filter_features(), and
b38b0f
was not supposed to appear on the CPU model table.
b38b0f
b38b0f
Remove the OSPKE flag from the CPU model table entries, to avoid
b38b0f
the bogus warning and avoid returning invalid feature data on
b38b0f
query-cpu-* QMP commands.  As OSPKE was always cleared by
b38b0f
x86_cpu_filter_features(), this won't have any guest-visible
b38b0f
impact.
b38b0f
b38b0f
Include a test case that should detect the problem if we introduce
b38b0f
a similar bug again.
b38b0f
b38b0f
Fixes: c7a88b52f62b ("i386: Add new model of Cascadelake-Server")
b38b0f
Fixes: 8a11c62da914 ("i386: Add new CPU model Icelake-{Server,Client}")
b38b0f
Cc: Tao Xu <tao3.xu@intel.com>
b38b0f
Cc: Robert Hoo <robert.hu@linux.intel.com>
b38b0f
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
b38b0f
Message-Id: <20190319200515.14999-1-ehabkost@redhat.com>
b38b0f
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
b38b0f
(cherry picked from commit bb4928c7cafe50ab2137a0034e350ef1bfa044d9)
b38b0f
Signed-off-by: Paul Lai <plai@redhat.com>
b38b0f
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
b38b0f
b38b0f
Conflicts:
b38b0f
	target/i386/cpu.c
b38b0f
b38b0f
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
b38b0f
---
b38b0f
 target/i386/cpu.c | 2 +-
b38b0f
 1 file changed, 1 insertion(+), 1 deletion(-)
b38b0f
b38b0f
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
b38b0f
index 2538d82..af62281 100644
b38b0f
--- a/target/i386/cpu.c
b38b0f
+++ b/target/i386/cpu.c
b38b0f
@@ -2517,7 +2517,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
b38b0f
             CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
b38b0f
             CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT,
b38b0f
         .features[FEAT_7_0_ECX] =
b38b0f
-            CPUID_7_0_ECX_PKU | CPUID_7_0_ECX_OSPKE |
b38b0f
+            CPUID_7_0_ECX_PKU |
b38b0f
             CPUID_7_0_ECX_AVX512VNNI,
b38b0f
         .features[FEAT_7_0_EDX] =
b38b0f
             CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,
b38b0f
-- 
b38b0f
1.8.3.1
b38b0f