cryptospore / rpms / qemu-kvm

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