Re: [PATCH] target/s390x: Make container ids in SysIB_15x 1-based

Hendrik Brueckner <[email protected]> Tue, 12 May 2026 16:35:10 +0200
Newsgroups org.nongnu.qemu-trivial,org.nongnu.qemu-devel
Message-ID <[email protected]>
On Mon, May 11, 2026 at 03:49:09PM +0200, Alexandra Winter wrote:
> 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")
> Signed-off-by: Alexandra Winter <[email protected]>

Acked-by: Hendrik Brueckner <[email protected]>