s390x/tcg: Fix CPU address returned by STIDP
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 5 Jun 2023 11:39:47 +0000 (13:39 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 5 Jun 2023 18:48:34 +0000 (20:48 +0200)
commit71b11cbe1c34411238703abe24bfaf2e9712c30d
tree722c3f1a7cbf0525ada8658f8dd2ea1baf6c9dc6
parent7d5b0d68647c8f966c6e4e68ed669127186b4701
s390x/tcg: Fix CPU address returned by STIDP

In qemu-user-s390x, /proc/cpuinfo contains:

processor 0: version = 00,  identification = 000000,  machine = 8561
processor 1: version = 00,  identification = 400000,  machine = 8561

The highest nibble is supposed to contain the CPU address, but it's off
by 2 bits. Fix the shift value and provide a symbolic constant for it.

With the fix we get:

processor 0: version = 00,  identification = 000000,  machine = 8561
processor 1: version = 00,  identification = 100000,  machine = 8561

Fixes: 076d4d39b65f ("s390x/cpumodel: wire up cpu type + id for TCG")
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230605113950.1169228-2-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
target/s390x/cpu_models.c
target/s390x/cpu_models.h