From cda6d7e282af53264228cdb4b233f624ab074161 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:40 +0200 Subject: [PATCH 01/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.10 machine type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The s390-ccw-virtio-2.10 machine is older than 6 years, so according to our machine support policy, it can be removed now. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-2-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index d5658afed9..206124f7a4 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -1275,18 +1275,6 @@ static void ccw_machine_2_11_class_options(MachineClass *mc) } DEFINE_CCW_MACHINE(2, 11); -static void ccw_machine_2_10_instance_options(MachineState *machine) -{ - ccw_machine_2_11_instance_options(machine); -} - -static void ccw_machine_2_10_class_options(MachineClass *mc) -{ - ccw_machine_2_11_class_options(mc); - compat_props_add(mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); -} -DEFINE_CCW_MACHINE(2, 10); - #endif static void ccw_machine_register_types(void) From ea9544b7e8e1e1ce971877e1e1367d98209543ef Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:41 +0200 Subject: [PATCH 02/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.11 machine type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The s390-ccw-virtio-2.11 machine is older than 6 years, so according to our machine support policy, it can be removed now. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-3-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 206124f7a4..104a24ee00 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -1252,31 +1252,6 @@ static void ccw_machine_2_12_class_options(MachineClass *mc) } DEFINE_CCW_MACHINE(2, 12); -#ifdef CONFIG_S390X_LEGACY_CPUS - -static void ccw_machine_2_11_instance_options(MachineState *machine) -{ - static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 }; - ccw_machine_2_12_instance_options(machine); - - /* before 2.12 we emulated the very first z900 */ - s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat); -} - -static void ccw_machine_2_11_class_options(MachineClass *mc) -{ - static GlobalProperty compat[] = { - { TYPE_SCLP_EVENT_FACILITY, "allow_all_mask_sizes", "off", }, - }; - - ccw_machine_2_12_class_options(mc); - compat_props_add(mc->compat_props, hw_compat_2_11, hw_compat_2_11_len); - compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); -} -DEFINE_CCW_MACHINE(2, 11); - -#endif - static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); From b80fadee690f9eef193e4ad4113ee2f2265ac174 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:42 +0200 Subject: [PATCH 03/13] hw/s390x/event-facility: Remove the obsolete "allow_all_mask_sizes" code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that the machine types 2.11 and older have been removed, we don't need the "allow_all_mask_sizes" compatibility handling code anymore and can remove it now. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-4-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/event-facility.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 1afe364573..7b7bf237fe 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -45,13 +45,6 @@ struct SCLPEventFacility { uint32_t receive_mask_pieces[2]; sccb_mask_t receive_mask; }; - /* - * when false, we keep the same broken, backwards compatible behaviour as - * before, allowing only masks of size exactly 4; when true, we implement - * the architecture correctly, allowing all valid mask sizes. Needed for - * migration toward older versions. - */ - bool allow_all_mask_sizes; /* length of the receive mask */ uint16_t mask_length; }; @@ -294,8 +287,7 @@ static void write_event_mask(SCLPEventFacility *ef, SCCB *sccb) uint16_t mask_length = be16_to_cpu(we_mask->mask_length); sccb_mask_t tmp_mask; - if (!mask_length || (mask_length > SCLP_EVENT_MASK_LEN_MAX) || - ((mask_length != 4) && !ef->allow_all_mask_sizes)) { + if (!mask_length || mask_length > SCLP_EVENT_MASK_LEN_MAX) { sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_MASK_LENGTH); return; } @@ -355,13 +347,6 @@ static bool vmstate_event_facility_mask64_needed(void *opaque) return (ef->receive_mask & 0xFFFFFFFF) != 0; } -static bool vmstate_event_facility_mask_length_needed(void *opaque) -{ - SCLPEventFacility *ef = opaque; - - return ef->allow_all_mask_sizes; -} - static const VMStateDescription vmstate_event_facility_mask64 = { .name = "vmstate-event-facility/mask64", .version_id = 0, @@ -377,7 +362,6 @@ static const VMStateDescription vmstate_event_facility_mask_length = { .name = "vmstate-event-facility/mask_length", .version_id = 0, .minimum_version_id = 0, - .needed = vmstate_event_facility_mask_length_needed, .fields = (const VMStateField[]) { VMSTATE_UINT16(mask_length, SCLPEventFacility), VMSTATE_END_OF_LIST() @@ -399,31 +383,12 @@ static const VMStateDescription vmstate_event_facility = { } }; -static void sclp_event_set_allow_all_mask_sizes(Object *obj, bool value, - Error **errp) -{ - SCLPEventFacility *ef = (SCLPEventFacility *)obj; - - ef->allow_all_mask_sizes = value; -} - -static bool sclp_event_get_allow_all_mask_sizes(Object *obj, Error **errp) -{ - SCLPEventFacility *ef = (SCLPEventFacility *)obj; - - return ef->allow_all_mask_sizes; -} - static void init_event_facility(Object *obj) { SCLPEventFacility *event_facility = EVENT_FACILITY(obj); DeviceState *sdev = DEVICE(obj); event_facility->mask_length = 4; - event_facility->allow_all_mask_sizes = true; - object_property_add_bool(obj, "allow_all_mask_sizes", - sclp_event_get_allow_all_mask_sizes, - sclp_event_set_allow_all_mask_sizes); /* Spawn a new bus for SCLP events */ qbus_init(&event_facility->sbus, sizeof(event_facility->sbus), From edce9fe075fac9f8189829a040e760f8c301a012 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:43 +0200 Subject: [PATCH 04/13] target/s390x: Rename the qemu_V2_11 feature set to qemu_MIN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that the v2.11 machine type has been removed, it does not make sense to keep the qemu_V2_11 feature set around. This is rather the (minimum) feature set of the oldest supported machine now, so rename it to qemu_MIN. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-5-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- target/s390x/gen-features.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 41840677ce..754fc843d2 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -844,7 +844,8 @@ static uint16_t default_GEN17_GA1[] = { /* QEMU (CPU model) features */ -static uint16_t qemu_V2_11[] = { +static uint16_t qemu_MIN[] = { + /* Features supported by the default CPU of the oldest machine type */ S390_FEAT_GROUP_PLO, S390_FEAT_ESAN3, S390_FEAT_ZARCH, @@ -1053,7 +1054,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { * QEMU (CPU model) features *******************************/ static FeatGroupDefSpec QemuFeatDef[] = { - QEMU_FEAT_INITIALIZER(V2_11), + QEMU_FEAT_INITIALIZER(MIN), QEMU_FEAT_INITIALIZER(V3_1), QEMU_FEAT_INITIALIZER(V4_0), QEMU_FEAT_INITIALIZER(V4_1), From fa3452c3914505e7352379179c10a22cc9017f84 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:44 +0200 Subject: [PATCH 05/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.12 machine type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The s390-ccw-virtio-2.12 machine is older than 6 years, so according to our machine support policy, it can be removed now. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-6-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 104a24ee00..db3d26b2e4 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -1238,20 +1238,6 @@ static void ccw_machine_3_0_class_options(MachineClass *mc) } DEFINE_CCW_MACHINE(3, 0); -static void ccw_machine_2_12_instance_options(MachineState *machine) -{ - ccw_machine_3_0_instance_options(machine); - s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15); - s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB); -} - -static void ccw_machine_2_12_class_options(MachineClass *mc) -{ - ccw_machine_3_0_class_options(mc); - compat_props_add(mc->compat_props, hw_compat_2_12, hw_compat_2_12_len); -} -DEFINE_CCW_MACHINE(2, 12); - static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); From 240e7c36e75767ef102bd2c532947800aa0030d6 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:45 +0200 Subject: [PATCH 06/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 3.0 machine type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The s390-ccw-virtio-3.0 machine is older than 6 years, so according to our machine support policy, it can be removed now. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-7-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index db3d26b2e4..bec4690e85 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -1223,21 +1223,6 @@ static void ccw_machine_3_1_class_options(MachineClass *mc) } DEFINE_CCW_MACHINE(3, 1); -static void ccw_machine_3_0_instance_options(MachineState *machine) -{ - ccw_machine_3_1_instance_options(machine); -} - -static void ccw_machine_3_0_class_options(MachineClass *mc) -{ - S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc); - - s390mc->hpage_1m_allowed = false; - ccw_machine_3_1_class_options(mc); - compat_props_add(mc->compat_props, hw_compat_3_0, hw_compat_3_0_len); -} -DEFINE_CCW_MACHINE(3, 0); - static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); From bbe6f504ef181f3745762818249bbf7ca44bf363 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:46 +0200 Subject: [PATCH 07/13] hw/s390x: Remove the obsolete hpage_1m_allowed switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The s390-ccw-virtio-3.0 machine was the last one that used the hpage_1m_allowed switch. Since we removed this machine type, we can now remove the switch and the related code, too. This allows us to get rid of the get_machine_class() hack and the big fat warning comment there. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-8-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 35 ------------------------------ include/hw/s390x/s390-virtio-ccw.h | 4 ---- target/s390x/kvm/kvm.c | 6 ----- 3 files changed, 45 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index bec4690e85..b013bcd076 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -748,39 +748,6 @@ static inline void machine_set_dea_key_wrap(Object *obj, bool value, ms->dea_key_wrap = value; } -static S390CcwMachineClass *current_mc; - -/* - * Get the class of the s390-ccw-virtio machine that is currently in use. - * Note: libvirt is using the "none" machine to probe for the features of the - * host CPU, so in case this is called with the "none" machine, the function - * returns the TYPE_S390_CCW_MACHINE base class. In this base class, all the - * various "*_allowed" variables are enabled, so that the *_allowed() wrappers - * below return the correct default value for the "none" machine. - * - * Attention! Do *not* add additional new wrappers for CPU features via this - * mechanism anymore. CPU features should be handled via the CPU models, - * i.e. checking with s390_has_feat() should be sufficient. - */ -static S390CcwMachineClass *get_machine_class(void) -{ - if (unlikely(!current_mc)) { - /* - * No s390 ccw machine was instantiated, we are likely to - * be called for the 'none' machine. The properties will - * have their after-initialization values. - */ - current_mc = S390_CCW_MACHINE_CLASS( - object_class_by_name(TYPE_S390_CCW_MACHINE)); - } - return current_mc; -} - -bool hpage_1m_allowed(void) -{ - return get_machine_class()->hpage_1m_allowed; -} - static void machine_get_loadparm(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) @@ -814,7 +781,6 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data) S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc); DumpSKeysInterface *dsi = DUMP_SKEYS_INTERFACE_CLASS(oc); - s390mc->hpage_1m_allowed = true; s390mc->max_threads = 1; mc->reset = s390_machine_reset; mc->block_default_type = IF_VIRTIO; @@ -888,7 +854,6 @@ static const TypeInfo ccw_machine_info = { #define DEFINE_CCW_MACHINE_IMPL(latest, ...) \ static void MACHINE_VER_SYM(mach_init, ccw, __VA_ARGS__)(MachineState *mach) \ { \ - current_mc = S390_CCW_MACHINE_CLASS(MACHINE_GET_CLASS(mach)); \ MACHINE_VER_SYM(instance_options, ccw, __VA_ARGS__)(mach); \ ccw_init(mach); \ } \ diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h index 686d9497d2..321b26df30 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -53,11 +53,7 @@ struct S390CcwMachineClass { MachineClass parent_class; /*< public >*/ - bool hpage_1m_allowed; int max_threads; }; -/* 1M huge page mappings allowed by the machine */ -bool hpage_1m_allowed(void); - #endif diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index b9f1422197..6cd2ebc5f1 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -298,12 +298,6 @@ void kvm_s390_set_max_pagesize(uint64_t pagesize, Error **errp) return; } - if (!hpage_1m_allowed()) { - error_setg(errp, "This QEMU machine does not support huge page " - "mappings"); - return; - } - if (pagesize != 1 * MiB) { error_setg(errp, "Memory backing with 2G pages was specified, " "but KVM does not support this memory backing"); From 3b912daea079445aad40d8e189c40597b229cf10 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:47 +0200 Subject: [PATCH 08/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 3.1 machine type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The s390-ccw-virtio-3.1 machine is older than 6 years, so according to our machine support policy, it can be removed now. The v3.1 CPU feature group gets merged into the minimum CPU feature group now. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-9-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 16 ---------------- target/s390x/gen-features.c | 4 ---- 2 files changed, 20 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index b013bcd076..95c12a4177 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -1172,22 +1172,6 @@ static void ccw_machine_4_0_class_options(MachineClass *mc) } DEFINE_CCW_MACHINE(4, 0); -static void ccw_machine_3_1_instance_options(MachineState *machine) -{ - static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V3_1 }; - ccw_machine_4_0_instance_options(machine); - s390_cpudef_featoff_greater(14, 1, S390_FEAT_MULTIPLE_EPOCH); - s390_cpudef_group_featoff_greater(14, 1, S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF); - s390_set_qemu_cpu_model(0x2827, 12, 2, qemu_cpu_feat); -} - -static void ccw_machine_3_1_class_options(MachineClass *mc) -{ - ccw_machine_4_0_class_options(mc); - compat_props_add(mc->compat_props, hw_compat_3_1, hw_compat_3_1_len); -} -DEFINE_CCW_MACHINE(3, 1); - static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 754fc843d2..4346b92431 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -849,9 +849,6 @@ static uint16_t qemu_MIN[] = { S390_FEAT_GROUP_PLO, S390_FEAT_ESAN3, S390_FEAT_ZARCH, -}; - -static uint16_t qemu_V3_1[] = { S390_FEAT_DAT_ENH, S390_FEAT_IDTE_SEGMENT, S390_FEAT_STFLE, @@ -1055,7 +1052,6 @@ static FeatGroupDefSpec FeatGroupDef[] = { *******************************/ static FeatGroupDefSpec QemuFeatDef[] = { QEMU_FEAT_INITIALIZER(MIN), - QEMU_FEAT_INITIALIZER(V3_1), QEMU_FEAT_INITIALIZER(V4_0), QEMU_FEAT_INITIALIZER(V4_1), QEMU_FEAT_INITIALIZER(V6_0), From 1b432c51cd12e778079ee0cfd7e4c51aad928c65 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 6 May 2025 08:21:48 +0200 Subject: [PATCH 09/13] hw/s390x/s390-virtio-ccw: Remove the deprecated 4.0 machine type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The s390-ccw-virtio-4.0 machine is older than 6 years, so according to our machine support policy, it can be removed now. The corresponding v4.0 CPU feature group gets merged into the minimum feature group now. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250506062148.306084-10-thuth@redhat.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 14 -------------- target/s390x/gen-features.c | 4 ---- 2 files changed, 18 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 95c12a4177..431d6b782a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -1158,20 +1158,6 @@ static void ccw_machine_4_1_class_options(MachineClass *mc) } DEFINE_CCW_MACHINE(4, 1); -static void ccw_machine_4_0_instance_options(MachineState *machine) -{ - static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V4_0 }; - ccw_machine_4_1_instance_options(machine); - s390_set_qemu_cpu_model(0x2827, 12, 2, qemu_cpu_feat); -} - -static void ccw_machine_4_0_class_options(MachineClass *mc) -{ - ccw_machine_4_1_class_options(mc); - compat_props_add(mc->compat_props, hw_compat_4_0, hw_compat_4_0_len); -} -DEFINE_CCW_MACHINE(4, 0); - static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 4346b92431..a814ece82f 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -878,9 +878,6 @@ static uint16_t qemu_MIN[] = { S390_FEAT_ADAPTER_INT_SUPPRESSION, S390_FEAT_MSA_EXT_3, S390_FEAT_MSA_EXT_4, -}; - -static uint16_t qemu_V4_0[] = { /* * Only BFP bits are implemented (HFP, DFP, PFPO and DIVIDE TO INTEGER not * implemented yet). @@ -1052,7 +1049,6 @@ static FeatGroupDefSpec FeatGroupDef[] = { *******************************/ static FeatGroupDefSpec QemuFeatDef[] = { QEMU_FEAT_INITIALIZER(MIN), - QEMU_FEAT_INITIALIZER(V4_0), QEMU_FEAT_INITIALIZER(V4_1), QEMU_FEAT_INITIALIZER(V6_0), QEMU_FEAT_INITIALIZER(V6_2), From bdf12f2a56bf3f13c52eb51f0a994bbfe40706b2 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Fri, 9 May 2025 14:49:38 -0300 Subject: [PATCH 10/13] s390x: Fix leak in machine_set_loadparm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ASAN spotted a leaking string in machine_set_loadparm(): Direct leak of 9 byte(s) in 1 object(s) allocated from: #0 0x560ffb5bb379 in malloc ../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3 #1 0x7f1aca926518 in g_malloc ../glib/gmem.c:106 #2 0x7f1aca94113e in g_strdup ../glib/gstrfuncs.c:364 #3 0x560ffc8afbf9 in qobject_input_type_str ../qapi/qobject-input-visitor.c:542:12 #4 0x560ffc8a80ff in visit_type_str ../qapi/qapi-visit-core.c:349:10 #5 0x560ffbe6053a in machine_set_loadparm ../hw/s390x/s390-virtio-ccw.c:802:10 #6 0x560ffc0c5e52 in object_property_set ../qom/object.c:1450:5 #7 0x560ffc0d4175 in object_property_set_qobject ../qom/qom-qobject.c:28:10 #8 0x560ffc0c6004 in object_property_set_str ../qom/object.c:1458:15 #9 0x560ffbe2ae60 in update_machine_ipl_properties ../hw/s390x/ipl.c:569:9 #10 0x560ffbe2aa65 in s390_ipl_update_diag308 ../hw/s390x/ipl.c:594:5 #11 0x560ffbdee132 in handle_diag_308 ../target/s390x/diag.c:147:9 #12 0x560ffbebb956 in helper_diag ../target/s390x/tcg/misc_helper.c:137:9 #13 0x7f1a3c51c730 (/memfd:tcg-jit (deleted)+0x39730) Cc: qemu-stable@nongnu.org Signed-off-by: Fabiano Rosas Message-ID: <20250509174938.25935-1-farosas@suse.de> Fixes: 1fd396e3228 ("s390x: Register TYPE_S390_CCW_MACHINE properties as class properties") Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 431d6b782a..f69a4d8ed3 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -771,6 +771,7 @@ static void machine_set_loadparm(Object *obj, Visitor *v, } s390_ipl_fmt_loadparm(ms->loadparm, val, errp); + g_free(val); } static void ccw_machine_class_init(ObjectClass *oc, const void *data) From 6ea7a5762aa1aacb7a5410e4b805bb8c99c6f133 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 8 May 2025 16:41:16 +0200 Subject: [PATCH 11/13] include/hw/dma/xlnx_dpdma: Remove dependency on console.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit console.h brings a dependency on the and the pixman header file (if available), so we should avoid to include this file if it is not really necessary. console.h does not seem to be necessary for the xlnx_dpdma code, so drop the include here. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Message-ID: <20250508144120.163009-2-thuth@redhat.com> --- include/hw/dma/xlnx_dpdma.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/dma/xlnx_dpdma.h b/include/hw/dma/xlnx_dpdma.h index 1ec0d265be..484b2e377f 100644 --- a/include/hw/dma/xlnx_dpdma.h +++ b/include/hw/dma/xlnx_dpdma.h @@ -26,7 +26,6 @@ #define XLNX_DPDMA_H #include "hw/sysbus.h" -#include "ui/console.h" #include "system/dma.h" #include "qom/object.h" From 7c312d8539fe69338f7343b6514f2dc77ae2efa6 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 24 Apr 2025 11:06:40 +0200 Subject: [PATCH 12/13] tests/functional/test_s390x_tuxrun: Check whether the machine is available The s390x tuxrun test lacks the call to self.set_machine(), so this test is currently failing in case the 's390-ccw-virtio' machine has not been compiled into the binary. Add the check now to fix it. Signed-off-by: Thomas Huth Message-ID: <20250424090640.664217-1-thuth@redhat.com> --- tests/functional/test_s390x_tuxrun.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/test_s390x_tuxrun.py b/tests/functional/test_s390x_tuxrun.py index a7db4bfd84..8df3c6893b 100755 --- a/tests/functional/test_s390x_tuxrun.py +++ b/tests/functional/test_s390x_tuxrun.py @@ -24,6 +24,7 @@ class TuxRunS390xTest(TuxRunBaselineTest): 'bff7971fc2fef56372d98afe4557b82fd0a785a241e44c29b058e577ad1bbb44') def test_s390(self): + self.set_machine('s390-ccw-virtio') self.wait_for_shutdown=False self.common_tuxrun(kernel_asset=self.ASSET_S390X_KERNEL, rootfs_asset=self.ASSET_S390X_ROOTFS, From c23d3339ce8fc936d8c60a023ea2b052d847dc78 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 25 Mar 2025 09:17:13 +0100 Subject: [PATCH 13/13] tests/functional: Skip the screendump tests if the command is not available It is possible nowadays to compile QEMU without pixman support - in that case the screendump command is not available and the related tests fail. Thus skip these tests if the screendump command could not be executed. Signed-off-by: Thomas Huth Message-ID: <20250325081713.283490-2-thuth@redhat.com> --- tests/functional/test_arm_integratorcp.py | 6 ++++-- tests/functional/test_m68k_nextcube.py | 6 ++++-- tests/functional/test_mips64el_malta.py | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/functional/test_arm_integratorcp.py b/tests/functional/test_arm_integratorcp.py index a85b339d77..4f00924aa0 100755 --- a/tests/functional/test_arm_integratorcp.py +++ b/tests/functional/test_arm_integratorcp.py @@ -73,8 +73,10 @@ class IntegratorMachine(QemuSystemTest): framebuffer_ready = 'Console: switching to colour frame buffer device' wait_for_console_pattern(self, framebuffer_ready) self.vm.cmd('human-monitor-command', command_line='stop') - self.vm.cmd('human-monitor-command', - command_line='screendump %s' % screendump_path) + res = self.vm.cmd('human-monitor-command', + command_line='screendump %s' % screendump_path) + if 'unknown command' in res: + self.skipTest('screendump not available') logger = logging.getLogger('framebuffer') cpu_count = 1 diff --git a/tests/functional/test_m68k_nextcube.py b/tests/functional/test_m68k_nextcube.py index ff773a7994..13c72bd136 100755 --- a/tests/functional/test_m68k_nextcube.py +++ b/tests/functional/test_m68k_nextcube.py @@ -32,8 +32,10 @@ class NextCubeMachine(QemuSystemTest): # TODO: wait for the 'displaysurface_create 1120x832' trace-event. time.sleep(2) - self.vm.cmd('human-monitor-command', - command_line='screendump %s' % screenshot_path) + res = self.vm.cmd('human-monitor-command', + command_line='screendump %s' % screenshot_path) + if 'unknown command' in res: + self.skipTest('screendump not available') @skipIfMissingImports("PIL") def test_bootrom_framebuffer_size(self): diff --git a/tests/functional/test_mips64el_malta.py b/tests/functional/test_mips64el_malta.py index dd37212f9d..3cc79b74c1 100755 --- a/tests/functional/test_mips64el_malta.py +++ b/tests/functional/test_mips64el_malta.py @@ -155,8 +155,10 @@ class MaltaMachineFramebuffer(LinuxKernelTest): framebuffer_ready = 'Console: switching to colour frame buffer device' self.wait_for_console_pattern(framebuffer_ready) self.vm.cmd('human-monitor-command', command_line='stop') - self.vm.cmd('human-monitor-command', - command_line='screendump %s' % screendump_path) + res = self.vm.cmd('human-monitor-command', + command_line='screendump %s' % screendump_path) + if 'unknown command' in res: + self.skipTest('screendump not available') logger = logging.getLogger('framebuffer') match_threshold = 0.95