From 5c61c4d31ea23e30d79fb7d25d078d47701b2378 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 18 Sep 2025 17:41:25 +0200 Subject: [PATCH 03/10] redhat: Add new -rhel9.8.0 and -rhel10.2.0 machine types on s390x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Thomas Huth RH-MergeRequest: 412: Add -rhel9.8.0 and -rhel10.2.0 s390x machine types and enable the CPI feature RH-Jira: RHEL-104009 RHEL-105823 RHEL-73008 RH-Acked-by: Cédric Le Goater RH-Acked-by: Miroslav Rezanina RH-Commit: [3/3] e9ad89069cb4b9badb1b5f57d78a043c64411b65 (thuth/qemu-kvm-cs) Upstream Status: RHEL only JIRA: https://issues.redhat.com/browse/RHEL-105823 JIRA: https://issues.redhat.com/browse/RHEL-104009 Add new -rhel9.8.0 and -rhel10.2.0 machine types that enable the CPI feature and have the "relaxed-translation" for PCI passthrough devices enabled by default. Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 9be423858d..4937a0c3b8 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -1172,8 +1172,18 @@ DEFINE_CCW_MACHINE(4, 2); #endif /* disabled for RHEL */ +static void ccw_rhel_machine_10_2_0_instance_options(MachineState *machine) +{ +} + +static void ccw_rhel_machine_10_2_0_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE_AS_LATEST(10, 2, 0); + static void ccw_rhel_machine_10_0_0_instance_options(MachineState *machine) { + ccw_rhel_machine_10_2_0_instance_options(machine); } static void ccw_rhel_machine_10_0_0_class_options(MachineClass *mc) @@ -1183,12 +1193,28 @@ static void ccw_rhel_machine_10_0_0_class_options(MachineClass *mc) { TYPE_S390_PCI_DEVICE, "relaxed-translation", "off", }, }; + ccw_rhel_machine_10_2_0_class_options(mc); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); compat_props_add(mc->compat_props, hw_compat_rhel_10_2, hw_compat_rhel_10_2_len); compat_props_add(mc->compat_props, hw_compat_rhel_10_1, hw_compat_rhel_10_1_len); s390mc->use_cpi = false; } -DEFINE_CCW_MACHINE_AS_LATEST(10, 0, 0); +DEFINE_CCW_MACHINE(10, 0, 0); + +static void ccw_rhel_machine_9_8_0_instance_options(MachineState *machine) +{ + ccw_rhel_machine_10_2_0_instance_options(machine); +} + +static void ccw_rhel_machine_9_8_0_class_options(MachineClass *mc) +{ + ccw_rhel_machine_10_2_0_class_options(mc); + + /* NB: remember to copy this line to the *latest* RHEL 9 machine */ + compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); +} +DEFINE_CCW_MACHINE(9, 8, 0); static void ccw_rhel_machine_9_6_0_instance_options(MachineState *machine) { @@ -1197,9 +1223,11 @@ static void ccw_rhel_machine_9_6_0_instance_options(MachineState *machine) static void ccw_rhel_machine_9_6_0_class_options(MachineClass *mc) { + /* + * NB: -rhel9.6 was on a par with -rhel10.0, so we derive from that + * instead of deriving from the 9.8 machine type + */ ccw_rhel_machine_10_0_0_class_options(mc); - - /* NB: remember to move this line to the *latest* RHEL 9 machine */ compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); } DEFINE_CCW_MACHINE(9, 6, 0); -- 2.47.3