From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PULL 11/11] target/s390x: Add a CONFIG switch to disable legacy CPUs
Date: Fri, 7 Mar 2025 17:01:31 +0100 [thread overview]
Message-ID: <15a3d344-20d0-4a64-be1b-216cc137bfdf@linaro.org> (raw)
In-Reply-To: <92f9a303-6a25-452d-adc9-b246953baf50@redhat.com>
On 7/3/25 16:33, Thomas Huth wrote:
> On 07/03/2025 16.27, Philippe Mathieu-Daudé wrote:
>> Hi Thomas,
>>
>> On 24/6/24 11:10, Thomas Huth wrote:
>>> The oldest model that IBM still supports is the z13. Considering
>>> that each generation can "emulate" the previous two generations
>>> in hardware (via the "IBC" feature of the CPUs), this means that
>>> everything that is older than z114/196 is not an officially supported
>>> CPU model anymore. The Linux kernel still support the z10, so if
>>> we also take this into account, everything older than that can
>>> definitely be considered as a legacy CPU model.
>>>
>>> For downstream builds of QEMU, we would like to be able to disable
>>> these legacy CPUs in the build. Thus add a CONFIG switch that can be
>>> used to disable them (and old machine types that use them by default).
>>>
>>> Message-Id: <20240614125019.588928-1-thuth@redhat.com>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>> hw/s390x/s390-virtio-ccw.c | 5 +++++
>>> target/s390x/cpu_models.c | 9 +++++++++
>>> target/s390x/Kconfig | 5 +++++
>>> 3 files changed, 19 insertions(+)
>>>
>>> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
>>> index 3d0bc3e7f2..cd063f8b64 100644
>>> --- a/hw/s390x/s390-virtio-ccw.c
>>> +++ b/hw/s390x/s390-virtio-ccw.c
>>> @@ -47,6 +47,7 @@
>>> #include "migration/blocker.h"
>>> #include "qapi/visitor.h"
>>> #include "hw/s390x/cpu-topology.h"
>>> +#include CONFIG_DEVICES
>>> static Error *pv_mig_blocker;
>>> @@ -1126,6 +1127,8 @@ static void
>>> ccw_machine_2_12_class_options(MachineClass *mc)
>>> }
>>> DEFINE_CCW_MACHINE(2_12, "2.12", false);
>>> +#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 };
>>> @@ -1272,6 +1275,8 @@ static void
>>> ccw_machine_2_4_class_options(MachineClass *mc)
>>> }
>>> DEFINE_CCW_MACHINE(2_4, "2.4", false);
>>> +#endif
>>> +
>>> static void ccw_machine_register_types(void)
>>> {
>>> type_register_static(&ccw_machine_info);
>>> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
>>> index efb508cd2e..a27f4b6f79 100644
>>> --- a/target/s390x/cpu_models.c
>>> +++ b/target/s390x/cpu_models.c
>>> @@ -25,6 +25,7 @@
>>> #ifndef CONFIG_USER_ONLY
>>> #include "sysemu/sysemu.h"
>>> #include "target/s390x/kvm/pv.h"
>>> +#include CONFIG_DEVICES
>>> #endif
>>> #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name,
>>> _desc) \
>>> @@ -47,6 +48,13 @@
>>> * generation 15 one base feature and one optional feature have
>>> been deprecated.
>>> */
>>> static S390CPUDef s390_cpu_defs[] = {
>>> + /*
>>> + * Linux requires at least z10 nowadays, and IBM only supports
>>> recent CPUs
>>> + * (see https://www.ibm.com/support/pages/ibm-mainframe-life-
>>> cycle- history),
>>> + * so we consider older CPUs as legacy that can optionally be
>>> disabled via
>>> + * the CONFIG_S390X_LEGACY_CPUS config switch.
>>> + */
>>> +#if defined(CONFIG_S390X_LEGACY_CPUS) || defined(CONFIG_USER_ONLY)
>>> CPUDEF_INIT(0x2064, 7, 1, 38, 0x00000000U, "z900", "IBM zSeries
>>> 900 GA1"),
>>> CPUDEF_INIT(0x2064, 7, 2, 38, 0x00000000U, "z900.2", "IBM
>>> zSeries 900 GA2"),
>>> CPUDEF_INIT(0x2064, 7, 3, 38, 0x00000000U, "z900.3", "IBM
>>> zSeries 900 GA3"),
>>> @@ -64,6 +72,7 @@ static S390CPUDef s390_cpu_defs[] = {
>>> CPUDEF_INIT(0x2096, 9, 2, 40, 0x00000000U, "z9BC", "IBM System
>>> z9 BC GA1"),
>>> CPUDEF_INIT(0x2094, 9, 3, 40, 0x00000000U, "z9EC.3", "IBM
>>> System z9 EC GA3"),
>>> CPUDEF_INIT(0x2096, 9, 3, 40, 0x00000000U, "z9BC.2", "IBM
>>> System z9 BC GA2"),
>>> +#endif
>>> CPUDEF_INIT(0x2097, 10, 1, 43, 0x00000000U, "z10EC", "IBM
>>> System z10 EC GA1"),
>>> CPUDEF_INIT(0x2097, 10, 2, 43, 0x00000000U, "z10EC.2", "IBM
>>> System z10 EC GA2"),
>>> CPUDEF_INIT(0x2098, 10, 2, 43, 0x00000000U, "z10BC", "IBM
>>> System z10 BC GA1"),
>>> diff --git a/target/s390x/Kconfig b/target/s390x/Kconfig
>>> index d886be48b4..8a95f2bc3f 100644
>>> --- a/target/s390x/Kconfig
>>> +++ b/target/s390x/Kconfig
>>> @@ -2,3 +2,8 @@ config S390X
>>> bool
>>> select PCI
>>> select S390_FLIC
>>> +
>>> +config S390X_LEGACY_CPUS
>>> + bool
>>> + default y
>>
>> Do we have plan to deprecate or switch that off?
>
> No, this is mainly a config knob for downstream builds that do not want
> to include legacy CPUs, but for upstream it should be fine to keep those
> around.
>
> Why do you ask?
WRT single binary, trying to split target/ VS hw/, I was hoping Kconfig
switches would only affect hw/. CPUs are odd devices sitting in between.
Generic registration of QOM types isn't a trivial task neither...
Anyway I can postpone this file analysis, since s390x is a "simple"
target in my setup :)
next prev parent reply other threads:[~2025-03-07 16:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 9:10 [PULL 00/11] s390x and qtest patches 2024-06-24 Thomas Huth
2024-06-24 9:10 ` [PULL 01/11] hw/s390x/ccw: Make s390_ccw_get_dev_info() return a bool Thomas Huth
2024-06-24 9:10 ` [PULL 02/11] s390x/css: Make CCWDeviceClass::realize return bool Thomas Huth
2024-06-24 9:10 ` [PULL 03/11] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize() Thomas Huth
2024-06-24 9:10 ` [PULL 04/11] s390x/css: Make S390CCWDeviceClass::realize return bool Thomas Huth
2024-06-24 9:10 ` [PULL 05/11] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize() Thomas Huth
2024-06-24 9:10 ` [PULL 06/11] vfio/ccw: Fix the missed unrealize() call in error path Thomas Huth
2024-06-24 9:10 ` [PULL 07/11] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors Thomas Huth
2024-06-24 9:10 ` [PULL 08/11] tests/qtest/fuzz: fix memleak in qos_fuzz.c Thomas Huth
2024-06-24 9:10 ` [PULL 09/11] target/s390x/arch_dump: use correct byte order for pid Thomas Huth
2024-06-24 9:10 ` [PULL 10/11] MAINTAINERS: Cover all tests/qtest/migration-* files Thomas Huth
2024-06-24 9:10 ` [PULL 11/11] target/s390x: Add a CONFIG switch to disable legacy CPUs Thomas Huth
2025-03-07 15:27 ` Philippe Mathieu-Daudé
2025-03-07 15:33 ` Thomas Huth
2025-03-07 16:01 ` Philippe Mathieu-Daudé [this message]
2024-06-24 20:50 ` [PULL 00/11] s390x and qtest patches 2024-06-24 Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15a3d344-20d0-4a64-be1b-216cc137bfdf@linaro.org \
--to=philmd@linaro.org \
--cc=borntraeger@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).