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