Blame SOURCES/kvm-s390x-add-RHEL-7.6-machine-type-for-ccw.patch

1bdc94
From ea16161ecfee857c3d83841f806c5fa55837c483 Mon Sep 17 00:00:00 2001
1bdc94
From: Cornelia Huck <cohuck@redhat.com>
1bdc94
Date: Thu, 17 May 2018 11:52:08 +0200
1bdc94
Subject: [PATCH 2/8] s390x: add RHEL 7.6 machine type for ccw
1bdc94
1bdc94
RH-Author: Cornelia Huck <cohuck@redhat.com>
1bdc94
Message-id: <20180517115208.20738-1-cohuck@redhat.com>
1bdc94
Patchwork-id: 80375
1bdc94
O-Subject: [RHEL-7.6 qemu-kvm-ma PATCH v2] s390x: add RHEL 7.6 machine type for ccw
1bdc94
Bugzilla: 1562138
1bdc94
RH-Acked-by: David Hildenbrand <david@redhat.com>
1bdc94
RH-Acked-by: Thomas Huth <thuth@redhat.com>
1bdc94
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
1bdc94
1bdc94
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1562138
1bdc94
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16338248
1bdc94
Branch: rhv7/master-2.12.0
1bdc94
Upstream: n/a
1bdc94
Tested: Managedsave/restore between qemu-kvm-ma-2.10 and qemu-kvm-ma-2.12
1bdc94
        with 7.5.0 machine type; started guest with 7.6.0 machine type
1bdc94
1bdc94
Follows the s390x-specific 2.10->2.12 compat handling (sclp masks,
1bdc94
qemu cpu model) and introduces generic compat defines for 7.5->7.6
1bdc94
(even though not applicable on s390x).
1bdc94
1bdc94
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
1bdc94
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
1bdc94
---
1bdc94
 hw/s390x/s390-virtio-ccw.c | 35 ++++++++++++++++++++++++++++++++---
1bdc94
 include/hw/compat.h        | 28 ++++++++++++++++++++++++++++
1bdc94
 2 files changed, 60 insertions(+), 3 deletions(-)
1bdc94
1bdc94
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
1bdc94
index 3956ac3..64e2a3b 100644
1bdc94
--- a/hw/s390x/s390-virtio-ccw.c
1bdc94
+++ b/hw/s390x/s390-virtio-ccw.c
1bdc94
@@ -671,6 +671,8 @@ bool css_migration_enabled(void)
1bdc94
     }                                                                         \
1bdc94
     type_init(ccw_machine_register_##suffix)
1bdc94
 
1bdc94
+#if 0 /* Disabled for Red Hat Enterprise Linux */
1bdc94
+
1bdc94
 #define CCW_COMPAT_2_11 \
1bdc94
         HW_COMPAT_2_11 \
1bdc94
         {\
1bdc94
@@ -682,8 +684,6 @@ bool css_migration_enabled(void)
1bdc94
 #define CCW_COMPAT_2_10 \
1bdc94
         HW_COMPAT_2_10
1bdc94
 
1bdc94
-#if 0 /* Disabled for Red Hat Enterprise Linux */
1bdc94
-
1bdc94
 #define CCW_COMPAT_2_9 \
1bdc94
         HW_COMPAT_2_9 \
1bdc94
         {\
1bdc94
@@ -883,14 +883,43 @@ DEFINE_CCW_MACHINE(2_4, "2.4", false);
1bdc94
 
1bdc94
 #else
1bdc94
 
1bdc94
+/*
1bdc94
+ * like CCW_COMPAT_2_11, but includes HW_COMPAT_RHEL7_5 (derived from
1bdc94
+ * HW_COMPAT_2_11 and HW_COMPAT_2_10) instead of HW_COMPAT_2_11
1bdc94
+ */
1bdc94
+#define CCW_COMPAT_RHEL7_5 \
1bdc94
+        HW_COMPAT_RHEL7_5 \
1bdc94
+        {\
1bdc94
+            .driver   = TYPE_SCLP_EVENT_FACILITY,\
1bdc94
+            .property = "allow_all_mask_sizes",\
1bdc94
+            .value    = "off",\
1bdc94
+        },
1bdc94
+
1bdc94
+static void ccw_machine_rhel760_instance_options(MachineState *machine)
1bdc94
+{
1bdc94
+}
1bdc94
+
1bdc94
+static void ccw_machine_rhel760_class_options(MachineClass *mc)
1bdc94
+{
1bdc94
+}
1bdc94
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", true);
1bdc94
+
1bdc94
 static void ccw_machine_rhel750_instance_options(MachineState *machine)
1bdc94
 {
1bdc94
+    static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 };
1bdc94
+    ccw_machine_rhel760_instance_options(machine);
1bdc94
+
1bdc94
+    /* before 2.12 we emulated the very first z900, and RHEL 7.5 is
1bdc94
+       based on 2.10 */
1bdc94
+    s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat);
1bdc94
 }
1bdc94
 
1bdc94
 static void ccw_machine_rhel750_class_options(MachineClass *mc)
1bdc94
 {
1bdc94
+    ccw_machine_rhel760_class_options(mc);
1bdc94
+    SET_MACHINE_COMPAT(mc, CCW_COMPAT_RHEL7_5);
1bdc94
 }
1bdc94
-DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", true);
1bdc94
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
1bdc94
 
1bdc94
 #endif
1bdc94
 
1bdc94
diff --git a/include/hw/compat.h b/include/hw/compat.h
1bdc94
index 503b5c8..666eed9 100644
1bdc94
--- a/include/hw/compat.h
1bdc94
+++ b/include/hw/compat.h
1bdc94
@@ -450,4 +450,32 @@
1bdc94
         .value    = "off",\
1bdc94
     },
1bdc94
 
1bdc94
+/* The same as HW_COMPAT_2_11 + HW_COMPAT_2_10 */
1bdc94
+#define HW_COMPAT_RHEL7_5 \
1bdc94
+    { /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
1bdc94
+        .driver   = "hpet",\
1bdc94
+        .property = "hpet-offset-saved",\
1bdc94
+        .value    = "false",\
1bdc94
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
1bdc94
+        .driver   = "virtio-blk-pci",\
1bdc94
+        .property = "vectors",\
1bdc94
+        .value    = "2",\
1bdc94
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
1bdc94
+        .driver   = "vhost-user-blk-pci",\
1bdc94
+        .property = "vectors",\
1bdc94
+        .value    = "2",\
1bdc94
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
1bdc94
+        .driver   = "e1000",\
1bdc94
+        .property = "migrate_tso_props",\
1bdc94
+        .value    = "off",\
1bdc94
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
1bdc94
+        .driver   = "virtio-mouse-device",\
1bdc94
+        .property = "wheel-axis",\
1bdc94
+        .value    = "false",\
1bdc94
+    },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
1bdc94
+        .driver   = "virtio-tablet-device",\
1bdc94
+        .property = "wheel-axis",\
1bdc94
+        .value    = "false",\
1bdc94
+    },
1bdc94
+
1bdc94
 #endif /* HW_COMPAT_H */
1bdc94
-- 
1bdc94
1.8.3.1
1bdc94