All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.