Skip to contentSkip to conversation

s390x updates

GIT PULL Applied Cornelia Huck 2 participants 9 messages Jun 5 – Jun 6 Block layer

lore
Share & tools
lore
#0 lore raw

The following changes since commit 29c042c6e9d4a09d4a0ac3fa54aeb7ee08ce0bdc:

lcitool: remove Cirrus CI support (2026-06-03 12:45:38 -0400)

are available in the Git repository at:

https://gitlab.com/cohuck/qemu tags/s390x-20260605

for you to fetch changes up to 23cec0b2cd2eed05fc67148fc971bdcd147d3e94:

buildsys: Stop checking for ESA/390 host (2026-06-05 12:30:33 +0200)

----------------------------------------------------------------
s390x updates:
- several fixes, mostly pci related, also in the STSI implementation
- fix up some file patterns in MAINTAINERS
- stop looking for ESA/390 (pre-64 bit zArch) hosts

----------------------------------------------------------------
Alexandra Winter (1):
target/s390x: Make container ids in SysIB_15x 1-based

Farhan Ali (1):
s390x/pci: Fix interrupt forwarding disable for interpreted devices

Jaehoon Kim (1):
hw/s390x/ccw: Mark virtio-pci disable-legacy property as optional

Philippe Mathieu-Daudé (3):
MAINTAINERS: Fix s390x storage key/attribute device paths
MAINTAINERS: Fix tcg/s390x/ path
buildsys: Stop checking for ESA/390 host

Thomas Huth (1):
hw/s390x: Fix memory leaks after removing elements with QTAILQ_REMOVE

 MAINTAINERS                      |  6 +++---
 block/file-posix.c               |  2 +-
 configure                        | 12 ++----------
 disas/disas-host.c               |  2 +-
 hw/s390x/s390-pci-bus.c          |  2 +-
 hw/s390x/s390-pci-vfio.c         |  1 +
 hw/s390x/s390-virtio-ccw.c       |  2 +-
 include/qemu/cacheflush.h        |  2 +-
 include/qemu/timer.h             |  2 +-
 target/s390x/kvm/stsi-topology.c | 10 +++++-----
 util/cacheflush.c                |  2 +-
 11 files changed, 18 insertions(+), 25 deletions(-)
Signature · 1 line
2.54.0
#1 lore raw

[PULL 4/7] s390x/pci: Fix interrupt forwarding disable for interpreted devices

From: Farhan Ali <[email protected]>

Remove the FH_MASK_ENABLE check when disabling interrupt forwarding during device reset. This check was broken for the default case in the switch statement above, preventing proper cleanup of interrupt forwarding.

The pbdev->aif check in s390_pci_kvm_aif_disable() already guards against double-disabling of interrupt forwarding.

Message-ID: <[email protected]>

---
 hw/s390x/s390-pci-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-pci-bus.c +1 -1
index 4de7b587e8a5..eb2b6185db0a 100644
@@ -1504,7 +1504,7 @@ static void s390_pci_device_reset(DeviceState *dev)
         break;
     }
 
-    if (pbdev->interp && (pbdev->fh & FH_MASK_ENABLE)) {
+    if (pbdev->interp) {
         /* Interpreted devices were using interrupt forwarding */
         s390_pci_kvm_aif_disable(pbdev);
     } else if (pbdev->summary_ind) {
Signature · 1 line
2.54.0
#2 lore raw

[PULL 1/7] hw/s390x: Fix memory leaks after removing elements with QTAILQ_REMOVE

In reply to Cornelia Huck

From: Thomas Huth <[email protected]>

The elements that get removed with QTAILQ_REMOVE are never referenced afterwards anymore, so the corresponding memory should get freed.

Fixes 37fa32de70 ("s390x/pci: Honor DMA limits set by vfio")

Message-ID: <[email protected]>

---
 hw/s390x/s390-pci-vfio.c | 1 +
 1 file changed, 1 insertion(+)
hw/s390x/s390-pci-vfio.c +1 -0
index 7c754b656da0..db6de00bd285 100644
@@ -101,6 +101,7 @@ void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt)
     cnt->users--;
     if (cnt->users == 0) {
         QTAILQ_REMOVE(&s->zpci_dma_limit, cnt, link);
+        g_free(cnt);
     }
 }
 
Signature · 1 line
2.54.0
#3 lore raw

[PULL 3/7] hw/s390x/ccw: Mark virtio-pci disable-legacy property as optional

In reply to Cornelia Huck

From: Jaehoon Kim <[email protected]>

The s390-ccw-virtio-11.0 compatibility property for TYPE_VIRTIO_PCI "disable-legacy" causes QEMU to abort when instantiating vhost-user-fs-pci devices:

Unexpected error in object_property_find_err() at ../qom/object.c:1284:
qemu-system-s390x: -device vhost-user-fs-pci: can't apply global virtio-pci.disable-legacy=off: Property 'vhost-user-fs-pci.disable-legacy' not found

The issue occurs because some vhost-user devices like vhost-user-fs-pci only implement the non-transitional variant and do not define a generic device type. Non-transitional devices have disable-legacy hardcoded to "on" and do not expose it as a property, while only generic device types have the "disable-legacy" property. This affects users running older machine versions (11.0 and earlier) even when using the latest QEMU version.

Mark the global property as optional so it only applies to devices that actually have the property, allowing vhost-user devices without a generic variant to be instantiated successfully on older machine versions.

Fixes 26103c13cff0 ("hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)")

Message-ID: <[email protected]>

---
 hw/s390x/s390-virtio-ccw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-virtio-ccw.c +1 -1
index 4d35f9b10bcc..25a9fa495540 100644
@@ -946,7 +946,7 @@ static void ccw_machine_11_0_class_options(MachineClass *mc)
      * keep legacy virtio-pci enabled.
      */
     static GlobalProperty compat[] = {
-        { TYPE_VIRTIO_PCI, "disable-legacy", "off" },
+        { TYPE_VIRTIO_PCI, "disable-legacy", "off", .optional = true },
     };
     ccw_machine_11_1_class_options(mc);
     compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
Signature · 1 line
2.54.0
#4 lore raw

[PULL 6/7] MAINTAINERS: Fix tcg/s390x/ path

In reply to Cornelia Huck

From: Philippe Mathieu-Daudé <[email protected]>

This folder was renamed in commit 3704993f545 ("tcg/s390x: Rename from tcg/s390").

Message-ID: <[email protected]>

---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
index 48db280e478d..79ecac16fe01 100644
@@ -4171,7 +4171,7 @@ F: disas/riscv*.[ch]
 S390 TCG target
 M: Richard Henderson <[email protected]>
 S: Maintained
-F: tcg/s390/
+F: tcg/s390x/
 L: [email protected]
 
 SPARC TCG target
Signature · 1 line
2.54.0
#5 lore raw

[PULL 5/7] MAINTAINERS: Fix s390x storage key/attribute device paths

In reply to Cornelia Huck

From: Philippe Mathieu-Daudé <[email protected]>

Fixes 56e34834029 ("MAINTAINERS: split out s390x sections")

Message-ID: <[email protected]>

---
 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
MAINTAINERS +2 -2
index 4ff33eb630bd..48db280e478d 100644
@@ -2973,7 +2973,7 @@ M: Halil Pasic <[email protected]>
 M: Christian Borntraeger <[email protected]>
 R: Jason Herne <[email protected]>
 S: Supported
-F: hw/s390x/storage-keys.h
+F: include/hw/s390x/storage-keys.h
 F: hw/s390x/s390-skeys*.c
 L: [email protected]
 
@@ -2982,7 +2982,7 @@ M: Halil Pasic <[email protected]>
 M: Christian Borntraeger <[email protected]>
 R: Jason Herne <[email protected]>
 S: Supported
-F: hw/s390x/storage-attributes.h
+F: include/hw/s390x/storage-attributes.h
 F: hw/s390x/s390-stattrib*.c
 L: [email protected]
 
Signature · 1 line
2.54.0
#6 lore raw

[PULL 2/7] target/s390x: Make container ids in SysIB_15x 1-based

In reply to Cornelia Huck

From: Alexandra Winter <[email protected]>

The Container Id in a container-type TLE of SysIB_15x is defined as 8-bit unsigned nonzero integer. Make stsi fc 15 emulation architecture compliant, by starting the container ids at 1 for the lowest numbered container.

The qemu misbehaviour without this patch becomes obvious due to a recently proposed kernel fix. Older linux kernels pass the container ids from stsi fc15 unchanged to sysfs, i.e. starting at 1 on s390 hardware. This resulted in off-by-one values when compared to the values from HMC. A Linux kernel fix is being proposed to correct the sysfs topology ids by -1, so they start at 0, e.g. when displayed by 'lscpu -ye'. In case a KVM guest with a fixed kernel runs on a host with a qemu without this fix, this can result in container ids erroneously being shown as 255.
Example (Fixed guest on unfixed qemu):

$ lscpu -ye
CPU NODE DRAWER BOOK SOCKET CORE L1d:L1i:L2 ONLINE CONFIGURED POLARIZATION ADDRESS
  0    0    255  255    255    0 0:0:0         yes yes        vert-medium  0
  1    0    255  255      0    1 1:1:1         yes yes        vert-medium  1
After this fix:
$ lscpu -ye
CPU NODE DRAWER BOOK SOCKET CORE L1d:L1i:L2 ONLINE CONFIGURED POLARIZATION ADDRESS
  0    0      0    0      0    0 0:0:0         yes yes        vert-medium  0
  1    0      0    0      1    1 1:1:1         yes yes        vert-medium  1
Fixes f4f54b582f ("target/s390x/cpu topology: handle STSI(15) and build the SYSIB")

Message-ID: <[email protected]>

---
 target/s390x/kvm/stsi-topology.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
target/s390x/kvm/stsi-topology.c +5 -5
index 301d41b68d2e..afd00da0e68b 100644
@@ -90,9 +90,9 @@ static int stsi_topology_fill_sysib(S390TopologyList *topology_list,
     int last_drawer = -1;
     int last_book = -1;
     int last_socket = -1;
-    int drawer_id = 0;
-    int book_id = 0;
-    int socket_id = 0;
+    int drawer_id = 1;
+    int book_id = 1;
+    int socket_id = 1;
     int n = sizeof(SysIB_151x);
 
     QTAILQ_FOREACH(entry, topology_list, next) {
@@ -103,12 +103,12 @@ static int stsi_topology_fill_sysib(S390TopologyList *topology_list,
         if (level > 3 && drawer_change) {
             SYSIB_GUARD(n, sizeof(SYSIBContainerListEntry));
             p = fill_container(p, 3, drawer_id++);
-            book_id = 0;
+            book_id = 1;
         }
         if (level > 2 && book_change) {
             SYSIB_GUARD(n, sizeof(SYSIBContainerListEntry));
             p = fill_container(p, 2, book_id++);
-            socket_id = 0;
+            socket_id = 1;
         }
         if (socket_change) {
             SYSIB_GUARD(n, sizeof(SYSIBContainerListEntry));
Signature · 1 line
2.54.0
#7 lore raw

[PULL 7/7] buildsys: Stop checking for ESA/390 host

In reply to Cornelia Huck

From: Philippe Mathieu-Daudé <[email protected]>

We still build QEMU tools on 32-bit hosts (see commit cf634dfcd8f), however no OS supported by QEMU still runs on ESA/390 (Linux dropped support in release 4.1 in 2015).

Remove the configure check, directly checking for the 64-bit z/Architecture.

Also per commit 3704993f545 from 2020:

"we don't support s390, only 64-bit s390x hosts".

Message-ID: <[email protected]>

---
 block/file-posix.c        |  2 +-
 configure                 | 12 ++----------
 disas/disas-host.c        |  2 +-
 include/qemu/cacheflush.h |  2 +-
 include/qemu/timer.h      |  2 +-
 util/cacheflush.c         |  2 +-
 6 files changed, 7 insertions(+), 15 deletions(-)
block/file-posix.c +1 -1
index e49b13d6abb5..5019ddade9b5 100644
@@ -79,7 +79,7 @@
 #include <linux/hdreg.h>
 #include <linux/magic.h>
 #include <scsi/sg.h>
-#ifdef __s390__
+#ifdef __s390x__
 #include <asm/dasd.h>
 #endif
 #ifndef FS_NOCOW_FL
configure +2 -10
index 1ceb4d7ecc42..d786d3a7c9b4 100755
@@ -399,12 +399,8 @@ elif check_define _ARCH_PPC64 ; then
   else
     cpu="ppc64"
   fi
-elif check_define __s390__ ; then
-  if check_define __s390x__ ; then
-    cpu="s390x"
-  else
-    cpu="s390"
-  fi
+elif check_define __s390x__ ; then
+  cpu="s390x"
 elif check_define __riscv && check_define _LP64 ; then
   cpu="riscv64"
 elif check_define __aarch64__ ; then
@@ -461,10 +457,6 @@ case "$cpu" in
     linux_arch=riscv
     ;;
 
-  s390)
-    linux_arch=s390
-    CPU_CFLAGS="-m31"
-    ;;
   s390x)
     host_arch=s390x
     linux_arch=s390
disas/disas-host.c +1 -1
index 7cf432938e0b..d41235250a0a 100644
@@ -74,7 +74,7 @@ static void initialize_debug_host(CPUDebug *s)
     s->info.print_insn = print_insn_little_mips;
 #elif defined(__m68k__)
     s->info.print_insn = print_insn_m68k;
-#elif defined(__s390__)
+#elif defined(__s390x__)
     s->info.cap_arch = CS_ARCH_SYSZ;
     s->info.cap_insn_unit = 2;
     s->info.cap_insn_split = 6;
include/qemu/cacheflush.h +1 -1
index 8c64b8781458..0618966ddde0 100644
@@ -19,7 +19,7 @@
  * mappings of the same physical page(s).
  */
 
-#if defined(__x86_64__) || defined(__s390__)
+#if defined(__x86_64__) || defined(__s390x__)
 
 static inline void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len)
 {
include/qemu/timer.h +1 -1
index ec03635dd34c..9a62ac8cded1 100644
@@ -889,7 +889,7 @@ static inline int64_t cpu_get_host_ticks(void)
     return val;
 }
 
-#elif defined(__s390__)
+#elif defined(__s390x__)
 
 static inline int64_t cpu_get_host_ticks(void)
 {
util/cacheflush.c +1 -1
index 247c4ce29803..a44fb136f7e0 100644
@@ -223,7 +223,7 @@ static void __attribute__((constructor)) init_cache_info(void)
  * Architecture (+ OS) specific cache flushing mechanisms.
  */
 
-#if defined(__x86_64__) || defined(__s390__)
+#if defined(__x86_64__) || defined(__s390x__)
 
 /* Caches are coherent and do not require flushing; symbol inline. */
 
Signature · 1 line
2.54.0