yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
ae23c9
From 411b30bec63d20ebcbc90d933a3ff73851d60f5a Mon Sep 17 00:00:00 2001
ae23c9
From: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Date: Sun, 22 Apr 2018 02:44:30 +0100
ae23c9
Subject: pc: pc-*-rhel75.5.0 compat code
ae23c9
ae23c9
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-id: <20180422024430.10218-1-ehabkost@redhat.com>
ae23c9
Patchwork-id: 79845
ae23c9
O-Subject: [RHEL-8.0 qemu-kvm PATCH] pc: pc-*-rhel75.5.0 compat code
ae23c9
Bugzilla: 1569675
ae23c9
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
ae23c9
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
ae23c9
RH-Acked-by: Peter Xu <peterx@redhat.com>
ae23c9
ae23c9
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1569675
ae23c9
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=15862256
ae23c9
ae23c9
Based on the pc-*-2.11 and pc-*-2.10 compat code from upstream.
ae23c9
ae23c9
Not tested yet, but still better than having it completely broken
ae23c9
on RHEL-8.0 Alpha.  I plan to test it next week.
ae23c9
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 hw/i386/pc_piix.c    |  2 ++
ae23c9
 hw/i386/pc_q35.c     |  4 ++++
ae23c9
 include/hw/compat.h  | 28 ++++++++++++++++++++++++++++
ae23c9
 include/hw/i386/pc.h | 13 +++++++++++++
ae23c9
 4 files changed, 47 insertions(+)
ae23c9
ae23c9
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
ae23c9
index cc72512..e5add39 100644
ae23c9
--- a/hw/i386/pc_piix.c
ae23c9
+++ b/hw/i386/pc_piix.c
ae23c9
@@ -1166,6 +1166,8 @@ static void pc_machine_rhel750_options(MachineClass *m)
ae23c9
 {
ae23c9
     pc_machine_rhel7_options(m);
ae23c9
     m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)";
ae23c9
+    m->auto_enable_numa_with_memhp = false;
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_5_COMPAT);
ae23c9
 }
ae23c9
 
ae23c9
 DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750,
ae23c9
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
ae23c9
index dbf6bfa..ffc461d 100644
ae23c9
--- a/hw/i386/pc_q35.c
ae23c9
+++ b/hw/i386/pc_q35.c
ae23c9
@@ -431,8 +431,12 @@ static void pc_q35_init_rhel750(MachineState *machine)
ae23c9
 
ae23c9
 static void pc_q35_machine_rhel750_options(MachineClass *m)
ae23c9
 {
ae23c9
+    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
ae23c9
     pc_q35_machine_rhel7_options(m);
ae23c9
     m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)";
ae23c9
+    m->auto_enable_numa_with_memhp = false;
ae23c9
+    pcmc->default_nic_model = "e1000";
ae23c9
+    SET_MACHINE_COMPAT(m, PC_RHEL7_5_COMPAT);
ae23c9
 }
ae23c9
 
ae23c9
 DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750,
ae23c9
diff --git a/include/hw/compat.h b/include/hw/compat.h
ae23c9
index de251fd..f7b39c5 100644
ae23c9
--- a/include/hw/compat.h
ae23c9
+++ b/include/hw/compat.h
ae23c9
@@ -446,4 +446,32 @@
ae23c9
         .value    = "off",\
ae23c9
     },
ae23c9
 
ae23c9
+/* The same as HW_COMPAT_2_11 + HW_COMPAT_2_10 */
ae23c9
+#define HW_COMPAT_RHEL7_5 \
ae23c9
+    { /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
ae23c9
+        .driver   = "hpet",\
ae23c9
+        .property = "hpet-offset-saved",\
ae23c9
+        .value    = "false",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
ae23c9
+        .driver   = "virtio-blk-pci",\
ae23c9
+        .property = "vectors",\
ae23c9
+        .value    = "2",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
ae23c9
+        .driver   = "vhost-user-blk-pci",\
ae23c9
+        .property = "vectors",\
ae23c9
+        .value    = "2",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
ae23c9
+        .driver   = "e1000",\
ae23c9
+        .property = "migrate_tso_props",\
ae23c9
+        .value    = "off",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
ae23c9
+        .driver   = "virtio-mouse-device",\
ae23c9
+        .property = "wheel-axis",\
ae23c9
+        .value    = "false",\
ae23c9
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
ae23c9
+        .driver   = "virtio-tablet-device",\
ae23c9
+        .property = "wheel-axis",\
ae23c9
+        .value    = "false",\
ae23c9
+    },
ae23c9
+
ae23c9
 #endif /* HW_COMPAT_H */
ae23c9
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
ae23c9
index faddeba..e94424f 100644
ae23c9
--- a/include/hw/i386/pc.h
ae23c9
+++ b/include/hw/i386/pc.h
ae23c9
@@ -969,6 +969,19 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
ae23c9
             .value = "on",\
ae23c9
         },
ae23c9
 
ae23c9
+/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but:
ae23c9
+ * - x-hv-max-vps was backported to 7.5
ae23c9
+ * - x-pci-hole64-fix was backported to 7.5
ae23c9
+ */
ae23c9
+#define PC_RHEL7_5_COMPAT \
ae23c9
+        HW_COMPAT_RHEL7_5 \
ae23c9
+        { /* PC_RHEL7_5_COMPAT from PC_COMPAT_2_11 */ \
ae23c9
+            .driver   = "Skylake-Server" "-" TYPE_X86_CPU,\
ae23c9
+            .property = "clflushopt",\
ae23c9
+            .value    = "off",\
ae23c9
+        },
ae23c9
+
ae23c9
+
ae23c9
 #define PC_RHEL7_4_COMPAT \
ae23c9
         HW_COMPAT_RHEL7_4 \
ae23c9
         { /* PC_RHEL7_4_COMPAT from PC_COMPAT_2_9 */ \
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9