qemu-kvm/0009-Add-s390x-machine-types.patch
Danilo C. L. de Paula b190fee134 Update qemu-kvm with 4.1.0 patches
Since qemu-kvm tree is syncronized with 4.1.0 now, it's
easier to handle this as 4.1.0 and not as rc4

- Resolves: bz#1740692
2019-08-19 22:32:15 +01:00

119 lines
4.3 KiB
Diff

From 2ae1e5940185a169886f2492f97fc98a625da889 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:47:32 +0200
Subject: Add s390x machine types
Adding changes to add RHEL machine types for s390x architecture.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase changes (weekly-190111):
- Use upstream compat handling
Merged patches (3.1.0):
- 29df663 s390x/cpumodel: default enable bpb and ppa15 for z196 and later
Merged patches (4.1.0-rc0):
- 6c200d665b hw/s390x/s390-virtio-ccw: Add machine types for RHEL8.0.0
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 67 +++++++++++++++++++++++++++++++++++++-
1 file changed, 66 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 5b6a9a4e55..4d8c2ec22a 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -636,7 +636,7 @@ bool css_migration_enabled(void)
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
ccw_machine_##suffix##_class_options(mc); \
- mc->desc = "VirtIO-ccw based S390 machine v" verstr; \
+ mc->desc = "VirtIO-ccw based S390 machine " verstr; \
if (latest) { \
mc->alias = "s390-ccw-virtio"; \
mc->is_default = 1; \
@@ -660,6 +660,7 @@ bool css_migration_enabled(void)
} \
type_init(ccw_machine_register_##suffix)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static void ccw_machine_4_1_instance_options(MachineState *machine)
{
}
@@ -873,6 +874,70 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
}
DEFINE_CCW_MACHINE(2_4, "2.4", false);
+#endif
+/*
+ * like CCW_COMPAT_2_12 + CCW_COMPAT_3_0 (which are empty), but includes
+ * HW_COMPAT_RHEL7_6 instead of HW_COMPAT_2_11 and HW_COMPAT_3_0
+ */
+
+GlobalProperty ccw_compat_rhel_7_6[] =
+{
+};
+const size_t ccw_compat_rhel_7_6_len = G_N_ELEMENTS(ccw_compat_rhel_7_6);
+
+GlobalProperty ccw_compat_rhel_7_5[] = {
+ {
+ .driver = TYPE_SCLP_EVENT_FACILITY,
+ .property = "allow_all_mask_sizes",
+ .value = "off",
+ },
+};
+const size_t ccw_compat_rhel_7_5_len = G_N_ELEMENTS(ccw_compat_rhel_7_5);
+
+static void ccw_machine_rhel800_instance_options(MachineState *machine)
+{
+}
+
+static void ccw_machine_rhel800_class_options(MachineClass *mc)
+{
+}
+DEFINE_CCW_MACHINE(rhel800, "rhel8.0.0", true);
+
+static void ccw_machine_rhel760_instance_options(MachineState *machine)
+{
+ ccw_machine_rhel800_instance_options(machine);
+}
+
+static void ccw_machine_rhel760_class_options(MachineClass *mc)
+{
+ ccw_machine_rhel800_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
+ compat_props_add(mc->compat_props, ccw_compat_rhel_7_6, ccw_compat_rhel_7_6_len);
+}
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false);
+
+static void ccw_machine_rhel750_instance_options(MachineState *machine)
+{
+ static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 };
+ ccw_machine_rhel760_instance_options(machine);
+
+ /* before 2.12 we emulated the very first z900, and RHEL 7.5 is
+ based on 2.10 */
+ s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat);
+
+ /* bpb and ppa15 were only in the full model in RHEL 7.5 */
+ s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15);
+ s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB);
+}
+
+static void ccw_machine_rhel750_class_options(MachineClass *mc)
+{
+ ccw_machine_rhel760_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
+ compat_props_add(mc->compat_props, ccw_compat_rhel_7_5, ccw_compat_rhel_7_5_len);
+ S390_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
+}
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
static void ccw_machine_register_types(void)
{
--
2.20.1