yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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