yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From b4307873bd68ead49bdccdde06c079dcc6a7e3ca Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Tue, 6 Jun 2017 13:03:15 +0200
Subject: [PATCH 14/17] pc: Use "min[x]level" on compat_props on RHEL
 machine-types

RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20170606130315.14990-1-ehabkost@redhat.com>
Patchwork-id: 75501
O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] pc: Use "min[x]level" on compat_props on RHEL machine-types
Bugzilla: 1454641
RH-Acked-by: Marcel Apfelbaum <marcel@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>

Since the automatic cpuid-level code was introduced in commit
c39c0edf9bb3b968ba95484465a50c7b19f4aa3a ("target-i386: Automatically
set level/xlevel/xlevel2 when needed"), the CPU model tables just define
the default CPUID level code (set using "min-level").  Setting
"[x]level" forces CPUID level to a specific value and disable the
automatic-level logic.

However, the PC compat code was not updated and the existing "[x]level"
compat properties broke compatibility for people using features that
triggered the auto-level code.  To keep previous behavior, we should set
"min-[x]level" instead of "[x]level" on compat_props.

This was not a problem for most cases, because old machine-types don't
have full-cpuid-auto-level enabled.  The only common use case it broke
was the CPUID[7] auto-level code, that was already enabled since the
first CPUID[7] feature was introduced (in QEMU 1.4.0).

This causes the regression reported at:
https://bugzilla.redhat.com/show_bug.cgi?id=1454641

Change the RHEL compat code to use "min-[x]level" instead of "[x]level"
on compat_props.

Upstream notes:

There's an upstream patch in a pending pull request already (1f43571604
"pc: Use "min-[x]level" on compat_props"), but we don't need it to be
backported because it only touches the upstream machine-types.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/i386/pc_piix.c    | 10 +++++-----
 include/hw/i386/pc.h | 36 ++++++++++++++++++------------------
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 038dda5..a9d4769 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1354,11 +1354,11 @@ DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
             .value    = "off",\
         },{\
             .driver = "qemu32-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value = stringify(0),\
         },{\
             .driver = "486-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value = stringify(0),\
         },{\
             .driver   = "qemu32-" TYPE_X86_CPU,\
@@ -1684,15 +1684,15 @@ DEFINE_PC_MACHINE(rhel640, "rhel6.4.0", pc_init_rhel640,
 #define PC_RHEL6_3_COMPAT \
         {\
             .driver   = "Conroe-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(2),\
         },{\
             .driver   = "Penryn-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(2),\
         },{\
             .driver   = "Nehalem-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(2),\
         },{\
             .driver   = "e1000",\
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index e05d838..3944e40 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -1237,75 +1237,75 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
 	},\
         { /* PC_RHEL7_1_COMPAT */ \
             .driver   = "qemu64" "-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(4),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "kvm64" "-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(5),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "pentium3" "-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(2),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "n270" "-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(5),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Conroe" "-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(4),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Penryn" "-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(4),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Nehalem" "-" TYPE_X86_CPU,\
-            .property = "level",\
+            .property = "min-level",\
             .value    = stringify(4),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "n270" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Penryn" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Conroe" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Nehalem" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Westmere" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "SandyBridge" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "IvyBridge" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Haswell" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Haswell-noTSX" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Broadwell" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },{ /* PC_RHEL7_1_COMPAT */ \
             .driver   = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
-            .property = "xlevel",\
+            .property = "min-xlevel",\
             .value    = stringify(0x8000000a),\
         },
 
-- 
1.8.3.1