febaa2
From 5116185549e3e5af307a4c7ee43005207809ab60 Mon Sep 17 00:00:00 2001
22c213
From: Miroslav Rezanina <mrezanin@redhat.com>
22c213
Date: Fri, 19 Oct 2018 13:47:32 +0200
22c213
Subject: Add s390x machine types
22c213
22c213
Adding changes to add RHEL machine types for s390x architecture.
22c213
22c213
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
22c213
22c213
Rebase changes (weekly-4.1.0):
22c213
- Use upstream compat handling
22c213
febaa2
Rebase notes (weekly-210303):
febaa2
- Use rhel-8.4.0 hw compat
febaa2
22c213
Merged patches (3.1.0):
22c213
- 29df663 s390x/cpumodel: default enable bpb and ppa15 for z196 and later
22c213
22c213
Merged patches (4.1.0):
22c213
- 6c200d665b hw/s390x/s390-virtio-ccw: Add machine types for RHEL8.0.0
22c213
22c213
Merged patches (4.2.0):
22c213
- fb192e5 redhat: s390x: Rename s390-ccw-virtio-rhel8.0.0 to s390-ccw-virtio-rhel8.1.0
22c213
- a9b22e8 redhat: s390x: Add proper compatibility options for the -rhel7.6.0 machine
22c213
- hw/s390x: Add the s390-ccw-virtio-rhel8.2.0 machine types (patch 92954)
22c213
febaa2
Merged patches (weekly-201216):
febaa2
- a6ae745cce redhat: s390x: add rhel-8.4.0 compat machine
febaa2
febaa2
Merged patches (weekly-210602):
febaa2
- 50835d3429 redhat: s390x: add rhel-8.5.0 compat machine
febaa2
22c213
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
22c213
---
febaa2
 hw/s390x/s390-virtio-ccw.c | 98 +++++++++++++++++++++++++++++++++++++-
febaa2
 1 file changed, 97 insertions(+), 1 deletion(-)
22c213
22c213
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
febaa2
index e4b18aef49..18effb8f7a 100644
22c213
--- a/hw/s390x/s390-virtio-ccw.c
22c213
+++ b/hw/s390x/s390-virtio-ccw.c
febaa2
@@ -767,7 +767,7 @@ bool css_migration_enabled(void)
22c213
     {                                                                         \
22c213
         MachineClass *mc = MACHINE_CLASS(oc);                                 \
22c213
         ccw_machine_##suffix##_class_options(mc);                             \
22c213
-        mc->desc = "VirtIO-ccw based S390 machine v" verstr;                  \
22c213
+        mc->desc = "VirtIO-ccw based S390 machine " verstr;                   \
22c213
         if (latest) {                                                         \
22c213
             mc->alias = "s390-ccw-virtio";                                    \
febaa2
             mc->is_default = true;                                            \
febaa2
@@ -791,6 +791,7 @@ bool css_migration_enabled(void)
22c213
     }                                                                         \
22c213
     type_init(ccw_machine_register_##suffix)
22c213
 
22c213
+#if 0 /* Disabled for Red Hat Enterprise Linux */
febaa2
 static void ccw_machine_6_1_instance_options(MachineState *machine)
22c213
 {
22c213
 }
febaa2
@@ -1082,6 +1083,101 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
22c213
     compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
22c213
 }
22c213
 DEFINE_CCW_MACHINE(2_4, "2.4", false);
22c213
+#endif
22c213
+
febaa2
+static void ccw_machine_rhel850_instance_options(MachineState *machine)
febaa2
+{
febaa2
+}
febaa2
+
febaa2
+static void ccw_machine_rhel850_class_options(MachineClass *mc)
febaa2
+{
febaa2
+}
febaa2
+DEFINE_CCW_MACHINE(rhel850, "rhel8.5.0", true);
febaa2
+
febaa2
+static void ccw_machine_rhel840_instance_options(MachineState *machine)
febaa2
+{
febaa2
+    ccw_machine_rhel850_instance_options(machine);
febaa2
+}
febaa2
+
febaa2
+static void ccw_machine_rhel840_class_options(MachineClass *mc)
febaa2
+{
febaa2
+    ccw_machine_rhel850_class_options(mc);
febaa2
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_4, hw_compat_rhel_8_4_len);
febaa2
+}
febaa2
+DEFINE_CCW_MACHINE(rhel840, "rhel8.4.0", false);
febaa2
+
22c213
+static void ccw_machine_rhel820_instance_options(MachineState *machine)
22c213
+{
febaa2
+    ccw_machine_rhel840_instance_options(machine);
22c213
+}
22c213
+
22c213
+static void ccw_machine_rhel820_class_options(MachineClass *mc)
22c213
+{
febaa2
+    ccw_machine_rhel840_class_options(mc);
febaa2
+    mc->fixup_ram_size = s390_fixup_ram_size;
febaa2
+    /* we did not publish a rhel8.3.0 machine */
febaa2
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_3, hw_compat_rhel_8_3_len);
febaa2
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_2, hw_compat_rhel_8_2_len);
22c213
+}
febaa2
+DEFINE_CCW_MACHINE(rhel820, "rhel8.2.0", false);
22c213
+
22c213
+static void ccw_machine_rhel760_instance_options(MachineState *machine)
22c213
+{
22c213
+    static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V3_1 };
22c213
+
22c213
+    ccw_machine_rhel820_instance_options(machine);
22c213
+
22c213
+    s390_set_qemu_cpu_model(0x2827, 12, 2, qemu_cpu_feat);
22c213
+
22c213
+    /* The multiple-epoch facility was not available with rhel7.6.0 on z14GA1 */
22c213
+    s390_cpudef_featoff(14, 1, S390_FEAT_MULTIPLE_EPOCH);
22c213
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_QSIE);
22c213
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_QTOUE);
22c213
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_STOE);
22c213
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_STOUE);
22c213
+}
22c213
+
22c213
+static void ccw_machine_rhel760_class_options(MachineClass *mc)
22c213
+{
22c213
+    ccw_machine_rhel820_class_options(mc);
22c213
+    /* We never published the s390x version of RHEL-AV 8.0 and 8.1, so add this here */
febaa2
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len);
22c213
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
22c213
+    compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
22c213
+}
22c213
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false);
22c213
+
22c213
+static void ccw_machine_rhel750_instance_options(MachineState *machine)
22c213
+{
22c213
+    static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 };
22c213
+    ccw_machine_rhel760_instance_options(machine);
22c213
+
22c213
+    /* before 2.12 we emulated the very first z900, and RHEL 7.5 is
22c213
+       based on 2.10 */
22c213
+    s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat);
22c213
+
22c213
+    /* bpb and ppa15 were only in the full model in RHEL 7.5 */
22c213
+    s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15);
22c213
+    s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB);
22c213
+}
22c213
+
22c213
+GlobalProperty ccw_compat_rhel_7_5[] = {
22c213
+        {
22c213
+            .driver   = TYPE_SCLP_EVENT_FACILITY,
22c213
+            .property = "allow_all_mask_sizes",
22c213
+            .value    = "off",
22c213
+        },
22c213
+};
22c213
+const size_t ccw_compat_rhel_7_5_len = G_N_ELEMENTS(ccw_compat_rhel_7_5);
22c213
+
22c213
+static void ccw_machine_rhel750_class_options(MachineClass *mc)
22c213
+{
22c213
+    ccw_machine_rhel760_class_options(mc);
22c213
+    compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
22c213
+    compat_props_add(mc->compat_props, ccw_compat_rhel_7_5, ccw_compat_rhel_7_5_len);
febaa2
+    S390_CCW_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
22c213
+}
22c213
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
22c213
 
22c213
 static void ccw_machine_register_types(void)
22c213
 {
22c213
-- 
febaa2
2.31.1
22c213