* [PATCH RFC v1 0/1] hw/s390x/ccw: Disable legacy mode
@ 2026-04-17 15:43 Jaehoon Kim
2026-04-17 15:43 ` [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+) Jaehoon Kim
0 siblings, 1 reply; 7+ messages in thread
From: Jaehoon Kim @ 2026-04-17 15:43 UTC (permalink / raw)
To: qemu-devel, qemu-s390x
Cc: richard.henderson, iii, david, pasic, borntraeger, farman,
mjrosato, cohuck, Jaehoon Kim
Hello,
This RFC proposes disabling legacy virtio-pci devices by default on
s390x starting from machine version 11.1.
Background:
The s390 kernel has never supported the legacy virtio-pci interface
despite QEMU advertising it. IO_SPACE_LIMIT has been 0 since the
initial zPCI implementation (commit cd24834130ac "s390/pci: base
support"), making I/O BARs unusable, so our driver never supported it.
When virtio-pci devices operate in transitional mode, QEMU
unconditionally exposes the legacy interface via BAR0. During PCI
enumeration, this results in firmware warnings such as:
pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size
even though the BAR is never usable on the s390 kernel.
It was also observed that forcing legacy-only mode (disable-modern=on)
does not work on s390x. The guest first attempts virtio_pci_modern_probe()
and then falls back to virtio_pci_legacy_probe(), which tries to map BAR0
via pci_iomap(). Since IO_SPACE_LIMIT=0 on s390, the BAR is unusable, the
mapping fails, and the device probe fails. This further confirms that
legacy support is not practically usable on s390x for new guests.
This patch closes this gap by disabling legacy virtio-pci support
starting from machine version 11.1, effectively making virtio-pci
devices non-transitional and preventing the creation of the unusable
legacy I/O BAR.
Implementation:
The patch introduces s390x-specific global compatibility properties that
set disable-legacy=on as the default for virtio-pci devices. Machine
versions v11.0 and earlier set disable-legacy=off to maintain their
original default behavior for compatibility.
Users can still override the default on the command line if needed:
- On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
- On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)
I would appreciate feedback on this approach.
Thanks,
Jaehoon Kim
Jaehoon Kim (1):
hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
hw/s390x/s390-virtio-ccw.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
--
2.50.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
2026-04-17 15:43 [PATCH RFC v1 0/1] hw/s390x/ccw: Disable legacy mode Jaehoon Kim
@ 2026-04-17 15:43 ` Jaehoon Kim
2026-04-17 15:49 ` Mohamed Mediouni
2026-04-20 10:12 ` Cornelia Huck
0 siblings, 2 replies; 7+ messages in thread
From: Jaehoon Kim @ 2026-04-17 15:43 UTC (permalink / raw)
To: qemu-devel, qemu-s390x
Cc: richard.henderson, iii, david, pasic, borntraeger, farman,
mjrosato, cohuck, Jaehoon Kim
On the s390 Linux kernel, IO_SPACE_LIMIT has been 0 since the initial
zPCI implementation (commit cd24834130ac "s390/pci: base support"),
making I/O BARs unusable.
However, when virtio-pci devices operate in transitional mode, QEMU
unconditionally exposes the legacy interface via BAR0. This results in
firmware warnings during PCI enumeration, such as:
pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size
even though BAR0 is never usable on the s390 kernel.
Close this gap by disabling legacy virtio-pci support starting from
machine version 11.1. This effectively makes virtio-pci devices
non-transitional and prevents the creation of the unusable legacy I/O
BAR.
This introduces s390x-specific global compatibility properties that
set disable-legacy=on as the default for virtio-pci devices. Machine
versions v11.0 and earlier set disable-legacy=off to maintain their
original default behavior (legacy support enabled), ensuring VMs
created with those versions continue to work identically.
Users can override the default on the command line if needed:
- On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
- On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)
Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
---
hw/s390x/s390-virtio-ccw.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index cc768daeb0..6fbea1e289 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -788,6 +788,18 @@ static void machine_set_loadparm(Object *obj, Visitor *v,
g_free(val);
}
+/*
+ * S390x-specific global compatibility properties.
+ *
+ * Set disable-legacy=on as the default for virtio-pci devices starting
+ * from v11.1. Machine versions v11.0 and earlier set disable-legacy=off
+ * to maintain their original default behavior (legacy support enabled).
+ */
+static GlobalProperty hw_compat_s390x[] = {
+ { TYPE_VIRTIO_PCI, "disable-legacy", "on", .optional = true},
+};
+static const size_t hw_compat_s390x_len = G_N_ELEMENTS(hw_compat_s390x);
+
static void ccw_machine_class_init(ObjectClass *oc, const void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -878,6 +890,9 @@ static const TypeInfo ccw_machine_info = {
const void *data) \
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
+ /* Apply global s390x-wide default properties */ \
+ compat_props_add(mc->compat_props, hw_compat_s390x, \
+ hw_compat_s390x_len); \
MACHINE_VER_SYM(class_options, ccw, __VA_ARGS__)(mc); \
mc->desc = "Virtual s390x machine (version " MACHINE_VER_STR(__VA_ARGS__) ")"; \
mc->init = MACHINE_VER_SYM(mach_init, ccw, __VA_ARGS__); \
@@ -923,7 +938,15 @@ static void ccw_machine_11_0_instance_options(MachineState *machine)
static void ccw_machine_11_0_class_options(MachineClass *mc)
{
+ /*
+ * Preserve v11.0 and older version behavior:
+ * keep legacy virtio-pci enabled.
+ */
+ static GlobalProperty compat[] = {
+ { TYPE_VIRTIO_PCI, "disable-legacy", "off" },
+ };
ccw_machine_11_1_class_options(mc);
+ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
compat_props_add(mc->compat_props, hw_compat_11_0, hw_compat_11_0_len);
}
DEFINE_CCW_MACHINE(11, 0);
--
2.50.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
2026-04-17 15:43 ` [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+) Jaehoon Kim
@ 2026-04-17 15:49 ` Mohamed Mediouni
2026-04-20 10:12 ` Cornelia Huck
1 sibling, 0 replies; 7+ messages in thread
From: Mohamed Mediouni @ 2026-04-17 15:49 UTC (permalink / raw)
To: Jaehoon Kim
Cc: qemu-devel, qemu-s390x, richard.henderson, iii, david, pasic,
borntraeger, farman, mjrosato, cohuck
> On 17. Apr 2026, at 17:43, Jaehoon Kim <jhkim@linux.ibm.com> wrote:
>
> On the s390 Linux kernel, IO_SPACE_LIMIT has been 0 since the initial
> zPCI implementation (commit cd24834130ac "s390/pci: base support"),
> making I/O BARs unusable.
>
> However, when virtio-pci devices operate in transitional mode, QEMU
> unconditionally exposes the legacy interface via BAR0. This results in
> firmware warnings during PCI enumeration, such as:
>
> pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size
>
> even though BAR0 is never usable on the s390 kernel.
>
> Close this gap by disabling legacy virtio-pci support starting from
> machine version 11.1. This effectively makes virtio-pci devices
> non-transitional and prevents the creation of the unusable legacy I/O
> BAR.
>
> This introduces s390x-specific global compatibility properties that
> set disable-legacy=on as the default for virtio-pci devices. Machine
> versions v11.0 and earlier set disable-legacy=off to maintain their
> original default behavior (legacy support enabled), ensuring VMs
> created with those versions continue to work identically.
>
> Users can override the default on the command line if needed:
> - On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
> - On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)
>
> Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
> ---
> hw/s390x/s390-virtio-ccw.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index cc768daeb0..6fbea1e289 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -788,6 +788,18 @@ static void machine_set_loadparm(Object *obj, Visitor *v,
> g_free(val);
> }
>
> +/*
> + * S390x-specific global compatibility properties.
> + *
> + * Set disable-legacy=on as the default for virtio-pci devices starting
> + * from v11.1. Machine versions v11.0 and earlier set disable-legacy=off
> + * to maintain their original default behavior (legacy support enabled).
> + */
> +static GlobalProperty hw_compat_s390x[] = {
> + { TYPE_VIRTIO_PCI, "disable-legacy", "on", .optional = true},
> +};
> +static const size_t hw_compat_s390x_len = G_N_ELEMENTS(hw_compat_s390x);
> +
> static void ccw_machine_class_init(ObjectClass *oc, const void *data)
> {
> MachineClass *mc = MACHINE_CLASS(oc);
> @@ -878,6 +890,9 @@ static const TypeInfo ccw_machine_info = {
> const void *data) \
> { \
> MachineClass *mc = MACHINE_CLASS(oc); \
> + /* Apply global s390x-wide default properties */ \
> + compat_props_add(mc->compat_props, hw_compat_s390x, \
> + hw_compat_s390x_len); \
> MACHINE_VER_SYM(class_options, ccw, __VA_ARGS__)(mc); \
> mc->desc = "Virtual s390x machine (version " MACHINE_VER_STR(__VA_ARGS__) ")"; \
> mc->init = MACHINE_VER_SYM(mach_init, ccw, __VA_ARGS__); \
> @@ -923,7 +938,15 @@ static void ccw_machine_11_0_instance_options(MachineState *machine)
>
> static void ccw_machine_11_0_class_options(MachineClass *mc)
> {
> + /*
> + * Preserve v11.0 and older version behavior:
> + * keep legacy virtio-pci enabled.
> + */
> + static GlobalProperty compat[] = {
> + { TYPE_VIRTIO_PCI, "disable-legacy", "off" },
> + };
> ccw_machine_11_1_class_options(mc);
> + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
> compat_props_add(mc->compat_props, hw_compat_11_0, hw_compat_11_0_len);
> }
> DEFINE_CCW_MACHINE(11, 0);
> --
> 2.50.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
2026-04-17 15:43 ` [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+) Jaehoon Kim
2026-04-17 15:49 ` Mohamed Mediouni
@ 2026-04-20 10:12 ` Cornelia Huck
2026-04-20 12:29 ` Matthew Rosato
1 sibling, 1 reply; 7+ messages in thread
From: Cornelia Huck @ 2026-04-20 10:12 UTC (permalink / raw)
To: Jaehoon Kim, qemu-devel, qemu-s390x
Cc: richard.henderson, iii, david, pasic, borntraeger, farman,
mjrosato, Jaehoon Kim
On Fri, Apr 17 2026, Jaehoon Kim <jhkim@linux.ibm.com> wrote:
> On the s390 Linux kernel, IO_SPACE_LIMIT has been 0 since the initial
> zPCI implementation (commit cd24834130ac "s390/pci: base support"),
> making I/O BARs unusable.
>
> However, when virtio-pci devices operate in transitional mode, QEMU
> unconditionally exposes the legacy interface via BAR0. This results in
> firmware warnings during PCI enumeration, such as:
>
> pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size
>
> even though BAR0 is never usable on the s390 kernel.
>
> Close this gap by disabling legacy virtio-pci support starting from
> machine version 11.1. This effectively makes virtio-pci devices
> non-transitional and prevents the creation of the unusable legacy I/O
> BAR.
>
> This introduces s390x-specific global compatibility properties that
> set disable-legacy=on as the default for virtio-pci devices. Machine
> versions v11.0 and earlier set disable-legacy=off to maintain their
> original default behavior (legacy support enabled), ensuring VMs
> created with those versions continue to work identically.
>
> Users can override the default on the command line if needed:
> - On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
> - On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)
Makes sense to disable legacy virtio-pci devices, if they cannot work
anyway. I'm wondering if we want to have a generic "no legacy" switch as
well. I remember a patch from some time ago, but that was concerned with
endianness IIRC.
Anyway, we cannot turn off pre-1.0 for virtio-ccw at the moment, because
the bios still uses legacy virtio. Would be a bit of an effort to change
that, but still sounds like a good idea to me.
>
> Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
> ---
> hw/s390x/s390-virtio-ccw.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index cc768daeb0..6fbea1e289 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -788,6 +788,18 @@ static void machine_set_loadparm(Object *obj, Visitor *v,
> g_free(val);
> }
>
> +/*
> + * S390x-specific global compatibility properties.
> + *
> + * Set disable-legacy=on as the default for virtio-pci devices starting
> + * from v11.1. Machine versions v11.0 and earlier set disable-legacy=off
> + * to maintain their original default behavior (legacy support enabled).
> + */
Maybe add here in the comment that legacy virtio-pci does not work anyway?
> +static GlobalProperty hw_compat_s390x[] = {
> + { TYPE_VIRTIO_PCI, "disable-legacy", "on", .optional = true},
> +};
> +static const size_t hw_compat_s390x_len = G_N_ELEMENTS(hw_compat_s390x);
> +
> static void ccw_machine_class_init(ObjectClass *oc, const void *data)
> {
> MachineClass *mc = MACHINE_CLASS(oc);
> @@ -878,6 +890,9 @@ static const TypeInfo ccw_machine_info = {
> const void *data) \
> { \
> MachineClass *mc = MACHINE_CLASS(oc); \
> + /* Apply global s390x-wide default properties */ \
> + compat_props_add(mc->compat_props, hw_compat_s390x, \
> + hw_compat_s390x_len); \
> MACHINE_VER_SYM(class_options, ccw, __VA_ARGS__)(mc); \
> mc->desc = "Virtual s390x machine (version " MACHINE_VER_STR(__VA_ARGS__) ")"; \
> mc->init = MACHINE_VER_SYM(mach_init, ccw, __VA_ARGS__); \
> @@ -923,7 +938,15 @@ static void ccw_machine_11_0_instance_options(MachineState *machine)
>
> static void ccw_machine_11_0_class_options(MachineClass *mc)
> {
> + /*
> + * Preserve v11.0 and older version behavior:
> + * keep legacy virtio-pci enabled.
> + */
> + static GlobalProperty compat[] = {
> + { TYPE_VIRTIO_PCI, "disable-legacy", "off" },
> + };
> ccw_machine_11_1_class_options(mc);
> + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
> compat_props_add(mc->compat_props, hw_compat_11_0, hw_compat_11_0_len);
> }
> DEFINE_CCW_MACHINE(11, 0);
> --
> 2.50.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
2026-04-20 10:12 ` Cornelia Huck
@ 2026-04-20 12:29 ` Matthew Rosato
2026-04-20 12:47 ` Cornelia Huck
0 siblings, 1 reply; 7+ messages in thread
From: Matthew Rosato @ 2026-04-20 12:29 UTC (permalink / raw)
To: Cornelia Huck, Jaehoon Kim, qemu-devel, qemu-s390x
Cc: richard.henderson, iii, david, pasic, borntraeger, farman
On 4/20/26 6:12 AM, Cornelia Huck wrote:
> On Fri, Apr 17 2026, Jaehoon Kim <jhkim@linux.ibm.com> wrote:
>
>> On the s390 Linux kernel, IO_SPACE_LIMIT has been 0 since the initial
>> zPCI implementation (commit cd24834130ac "s390/pci: base support"),
>> making I/O BARs unusable.
>>
>> However, when virtio-pci devices operate in transitional mode, QEMU
>> unconditionally exposes the legacy interface via BAR0. This results in
>> firmware warnings during PCI enumeration, such as:
>>
>> pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size
>>
>> even though BAR0 is never usable on the s390 kernel.
>>
>> Close this gap by disabling legacy virtio-pci support starting from
>> machine version 11.1. This effectively makes virtio-pci devices
>> non-transitional and prevents the creation of the unusable legacy I/O
>> BAR.
>>
>> This introduces s390x-specific global compatibility properties that
>> set disable-legacy=on as the default for virtio-pci devices. Machine
>> versions v11.0 and earlier set disable-legacy=off to maintain their
>> original default behavior (legacy support enabled), ensuring VMs
>> created with those versions continue to work identically.
>>
>> Users can override the default on the command line if needed:
>> - On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
>> - On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)
>
> Makes sense to disable legacy virtio-pci devices, if they cannot work
> anyway. I'm wondering if we want to have a generic "no legacy" switch as
> well. I remember a patch from some time ago, but that was concerned with
> endianness IIRC.
Thanks Connie, I was hoping to get your input on this idea.
By generic, do you mean disabling legacy virtio-pci (and legacy
virtio-ccw?) across QEMU for all platforms vs only disabling it for s390x?
>
> Anyway, we cannot turn off pre-1.0 for virtio-ccw at the moment, because
> the bios still uses legacy virtio. Would be a bit of an effort to change
> that, but still sounds like a good idea to me.
>
Good point, hadn't thought about that and I guess it would be a pre-req
if you really wanted to disable legacy virtio everywhere; we can
certainly put this on our todo list for later, but I'd still like a
patch like this one to fix the awkward s390x virtio-pci situation now.
Thanks,
Matt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
2026-04-20 12:29 ` Matthew Rosato
@ 2026-04-20 12:47 ` Cornelia Huck
2026-04-20 13:53 ` JAEHOON KIM
0 siblings, 1 reply; 7+ messages in thread
From: Cornelia Huck @ 2026-04-20 12:47 UTC (permalink / raw)
To: Matthew Rosato, Jaehoon Kim, qemu-devel, qemu-s390x
Cc: richard.henderson, iii, david, pasic, borntraeger, farman
On Mon, Apr 20 2026, Matthew Rosato <mjrosato@linux.ibm.com> wrote:
> On 4/20/26 6:12 AM, Cornelia Huck wrote:
>> On Fri, Apr 17 2026, Jaehoon Kim <jhkim@linux.ibm.com> wrote:
>>
>>> On the s390 Linux kernel, IO_SPACE_LIMIT has been 0 since the initial
>>> zPCI implementation (commit cd24834130ac "s390/pci: base support"),
>>> making I/O BARs unusable.
>>>
>>> However, when virtio-pci devices operate in transitional mode, QEMU
>>> unconditionally exposes the legacy interface via BAR0. This results in
>>> firmware warnings during PCI enumeration, such as:
>>>
>>> pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size
>>>
>>> even though BAR0 is never usable on the s390 kernel.
>>>
>>> Close this gap by disabling legacy virtio-pci support starting from
>>> machine version 11.1. This effectively makes virtio-pci devices
>>> non-transitional and prevents the creation of the unusable legacy I/O
>>> BAR.
>>>
>>> This introduces s390x-specific global compatibility properties that
>>> set disable-legacy=on as the default for virtio-pci devices. Machine
>>> versions v11.0 and earlier set disable-legacy=off to maintain their
>>> original default behavior (legacy support enabled), ensuring VMs
>>> created with those versions continue to work identically.
>>>
>>> Users can override the default on the command line if needed:
>>> - On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
>>> - On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)
>>
>> Makes sense to disable legacy virtio-pci devices, if they cannot work
>> anyway. I'm wondering if we want to have a generic "no legacy" switch as
>> well. I remember a patch from some time ago, but that was concerned with
>> endianness IIRC.
>
> Thanks Connie, I was hoping to get your input on this idea.
>
> By generic, do you mean disabling legacy virtio-pci (and legacy
> virtio-ccw?) across QEMU for all platforms vs only disabling it for s390x?
If we are moving towards multi-arch binaries, it would need to be the
latter; another benefit would be removing legacy bits from the virtio
core. But I think we'd still need quite some time before we get there
(virtio-pci switched to modern by default later than virtio-ccw.)
>
>>
>> Anyway, we cannot turn off pre-1.0 for virtio-ccw at the moment, because
>> the bios still uses legacy virtio. Would be a bit of an effort to change
>> that, but still sounds like a good idea to me.
>>
>
> Good point, hadn't thought about that and I guess it would be a pre-req
> if you really wanted to disable legacy virtio everywhere; we can
> certainly put this on our todo list for later, but I'd still like a
> patch like this one to fix the awkward s390x virtio-pci situation now.
Yep, this patch is fine for the current situation, I guess legacy
virtio-ccw will stay around for a bit longer (and there's no urgent need
to remove support for it as long as the virtio core still supports
legacy easily.)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
2026-04-20 12:47 ` Cornelia Huck
@ 2026-04-20 13:53 ` JAEHOON KIM
0 siblings, 0 replies; 7+ messages in thread
From: JAEHOON KIM @ 2026-04-20 13:53 UTC (permalink / raw)
To: Cornelia Huck, Matthew Rosato, qemu-devel, qemu-s390x
Cc: richard.henderson, iii, david, pasic, borntraeger, farman
On 4/20/2026 7:47 AM, Cornelia Huck wrote:
> On Mon, Apr 20 2026, Matthew Rosato <mjrosato@linux.ibm.com> wrote:
>
>> On 4/20/26 6:12 AM, Cornelia Huck wrote:
>>> On Fri, Apr 17 2026, Jaehoon Kim <jhkim@linux.ibm.com> wrote:
>>>
>>>> On the s390 Linux kernel, IO_SPACE_LIMIT has been 0 since the initial
>>>> zPCI implementation (commit cd24834130ac "s390/pci: base support"),
>>>> making I/O BARs unusable.
>>>>
>>>> However, when virtio-pci devices operate in transitional mode, QEMU
>>>> unconditionally exposes the legacy interface via BAR0. This results in
>>>> firmware warnings during PCI enumeration, such as:
>>>>
>>>> pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size
>>>>
>>>> even though BAR0 is never usable on the s390 kernel.
>>>>
>>>> Close this gap by disabling legacy virtio-pci support starting from
>>>> machine version 11.1. This effectively makes virtio-pci devices
>>>> non-transitional and prevents the creation of the unusable legacy I/O
>>>> BAR.
>>>>
>>>> This introduces s390x-specific global compatibility properties that
>>>> set disable-legacy=on as the default for virtio-pci devices. Machine
>>>> versions v11.0 and earlier set disable-legacy=off to maintain their
>>>> original default behavior (legacy support enabled), ensuring VMs
>>>> created with those versions continue to work identically.
>>>>
>>>> Users can override the default on the command line if needed:
>>>> - On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
>>>> - On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)
>>> Makes sense to disable legacy virtio-pci devices, if they cannot work
>>> anyway. I'm wondering if we want to have a generic "no legacy" switch as
>>> well. I remember a patch from some time ago, but that was concerned with
>>> endianness IIRC.
>> Thanks Connie, I was hoping to get your input on this idea.
>>
>> By generic, do you mean disabling legacy virtio-pci (and legacy
>> virtio-ccw?) across QEMU for all platforms vs only disabling it for s390x?
> If we are moving towards multi-arch binaries, it would need to be the
> latter; another benefit would be removing legacy bits from the virtio
> core. But I think we'd still need quite some time before we get there
> (virtio-pci switched to modern by default later than virtio-ccw.)
>
>>> Anyway, we cannot turn off pre-1.0 for virtio-ccw at the moment, because
>>> the bios still uses legacy virtio. Would be a bit of an effort to change
>>> that, but still sounds like a good idea to me.
>>>
>> Good point, hadn't thought about that and I guess it would be a pre-req
>> if you really wanted to disable legacy virtio everywhere; we can
>> certainly put this on our todo list for later, but I'd still like a
>> patch like this one to fix the awkward s390x virtio-pci situation now.
> Yep, this patch is fine for the current situation, I guess legacy
> virtio-ccw will stay around for a bit longer (and there's no urgent need
> to remove support for it as long as the virtio core still supports
> legacy easily.)
>
Thank you Connie and Matt for the discussion and feedback.
I'm glad this approach make sense for the current situation.
That's why I'll prepare a V2 with the suggested comment updates.
Regards,
Jaehoon Kim.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-04-20 13:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-17 15:43 [PATCH RFC v1 0/1] hw/s390x/ccw: Disable legacy mode Jaehoon Kim
2026-04-17 15:43 ` [PATCH RFC v1 1/1] hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+) Jaehoon Kim
2026-04-17 15:49 ` Mohamed Mediouni
2026-04-20 10:12 ` Cornelia Huck
2026-04-20 12:29 ` Matthew Rosato
2026-04-20 12:47 ` Cornelia Huck
2026-04-20 13:53 ` JAEHOON KIM
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.