ddf19c
From 0842700b3a01891c316e9169fa651f26714cafa5 Mon Sep 17 00:00:00 2001
ddf19c
From: Miroslav Rezanina <mrezanin@redhat.com>
ddf19c
Date: Fri, 19 Oct 2018 13:47:32 +0200
ddf19c
Subject: Add s390x machine types
ddf19c
ddf19c
Adding changes to add RHEL machine types for s390x architecture.
ddf19c
ddf19c
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ddf19c
ddf19c
Rebase changes (weekly-4.1.0):
ddf19c
- Use upstream compat handling
ddf19c
ddf19c
Merged patches (3.1.0):
ddf19c
- 29df663 s390x/cpumodel: default enable bpb and ppa15 for z196 and later
ddf19c
ddf19c
Merged patches (4.1.0):
ddf19c
- 6c200d665b hw/s390x/s390-virtio-ccw: Add machine types for RHEL8.0.0
ddf19c
ddf19c
Merged patches (4.2.0):
ddf19c
- fb192e5 redhat: s390x: Rename s390-ccw-virtio-rhel8.0.0 to s390-ccw-virtio-rhel8.1.0
ddf19c
- a9b22e8 redhat: s390x: Add proper compatibility options for the -rhel7.6.0 machine
ddf19c
- hw/s390x: Add the s390-ccw-virtio-rhel8.2.0 machine types (patch 92954)
ddf19c
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 hw/s390x/s390-virtio-ccw.c | 70 +++++++++++++++++++++++++++++++++++++-
ddf19c
 1 file changed, 69 insertions(+), 1 deletion(-)
ddf19c
ddf19c
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
ddf19c
index d3edeef0ad..c2c83d2fce 100644
ddf19c
--- a/hw/s390x/s390-virtio-ccw.c
ddf19c
+++ b/hw/s390x/s390-virtio-ccw.c
ddf19c
@@ -615,7 +615,7 @@ bool css_migration_enabled(void)
ddf19c
     {                                                                         \
ddf19c
         MachineClass *mc = MACHINE_CLASS(oc);                                 \
ddf19c
         ccw_machine_##suffix##_class_options(mc);                             \
ddf19c
-        mc->desc = "VirtIO-ccw based S390 machine v" verstr;                  \
ddf19c
+        mc->desc = "VirtIO-ccw based S390 machine " verstr;                   \
ddf19c
         if (latest) {                                                         \
ddf19c
             mc->alias = "s390-ccw-virtio";                                    \
ddf19c
             mc->is_default = 1;                                               \
ddf19c
@@ -639,6 +639,7 @@ bool css_migration_enabled(void)
ddf19c
     }                                                                         \
ddf19c
     type_init(ccw_machine_register_##suffix)
ddf19c
 
ddf19c
+#if 0 /* Disabled for Red Hat Enterprise Linux */
ddf19c
 static void ccw_machine_4_2_instance_options(MachineState *machine)
ddf19c
 {
ddf19c
 }
ddf19c
@@ -866,6 +867,73 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
ddf19c
     compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
ddf19c
 }
ddf19c
 DEFINE_CCW_MACHINE(2_4, "2.4", false);
ddf19c
+#endif
ddf19c
+
ddf19c
+static void ccw_machine_rhel820_instance_options(MachineState *machine)
ddf19c
+{
ddf19c
+}
ddf19c
+
ddf19c
+static void ccw_machine_rhel820_class_options(MachineClass *mc)
ddf19c
+{
ddf19c
+}
ddf19c
+DEFINE_CCW_MACHINE(rhel820, "rhel8.2.0", true);
ddf19c
+
ddf19c
+static void ccw_machine_rhel760_instance_options(MachineState *machine)
ddf19c
+{
ddf19c
+    static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V3_1 };
ddf19c
+
ddf19c
+    ccw_machine_rhel820_instance_options(machine);
ddf19c
+
ddf19c
+    s390_set_qemu_cpu_model(0x2827, 12, 2, qemu_cpu_feat);
ddf19c
+
ddf19c
+    /* The multiple-epoch facility was not available with rhel7.6.0 on z14GA1 */
ddf19c
+    s390_cpudef_featoff(14, 1, S390_FEAT_MULTIPLE_EPOCH);
ddf19c
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_QSIE);
ddf19c
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_QTOUE);
ddf19c
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_STOE);
ddf19c
+    s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_STOUE);
ddf19c
+}
ddf19c
+
ddf19c
+static void ccw_machine_rhel760_class_options(MachineClass *mc)
ddf19c
+{
ddf19c
+    ccw_machine_rhel820_class_options(mc);
ddf19c
+    /* We never published the s390x version of RHEL-AV 8.0 and 8.1, so add this here */
ddf19c
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
ddf19c
+    compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
ddf19c
+}
ddf19c
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false);
ddf19c
+
ddf19c
+static void ccw_machine_rhel750_instance_options(MachineState *machine)
ddf19c
+{
ddf19c
+    static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 };
ddf19c
+    ccw_machine_rhel760_instance_options(machine);
ddf19c
+
ddf19c
+    /* before 2.12 we emulated the very first z900, and RHEL 7.5 is
ddf19c
+       based on 2.10 */
ddf19c
+    s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat);
ddf19c
+
ddf19c
+    /* bpb and ppa15 were only in the full model in RHEL 7.5 */
ddf19c
+    s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15);
ddf19c
+    s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB);
ddf19c
+}
ddf19c
+
ddf19c
+GlobalProperty ccw_compat_rhel_7_5[] = {
ddf19c
+        {
ddf19c
+            .driver   = TYPE_SCLP_EVENT_FACILITY,
ddf19c
+            .property = "allow_all_mask_sizes",
ddf19c
+            .value    = "off",
ddf19c
+        },
ddf19c
+};
ddf19c
+const size_t ccw_compat_rhel_7_5_len = G_N_ELEMENTS(ccw_compat_rhel_7_5);
ddf19c
+
ddf19c
+static void ccw_machine_rhel750_class_options(MachineClass *mc)
ddf19c
+{
ddf19c
+    ccw_machine_rhel760_class_options(mc);
ddf19c
+    compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
ddf19c
+    compat_props_add(mc->compat_props, ccw_compat_rhel_7_5, ccw_compat_rhel_7_5_len);
ddf19c
+    S390_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
ddf19c
+}
ddf19c
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
ddf19c
 
ddf19c
 static void ccw_machine_register_types(void)
ddf19c
 {
ddf19c
-- 
ddf19c
2.21.0
ddf19c