On Fri, 2023-06-30 at 11:17 +0200, Pierre Morel wrote:
> On interception of STSI(15.1.x) the System Information Block
> (SYSIB) is built from the list of pre-ordered topology entries.
>
> Signed-off-by: Pierre Morel <[email protected]>
> ---
> MAINTAINERS | 1 +
> qapi/machine-target.json | 14 ++
> include/hw/s390x/cpu-topology.h | 25 +++
> include/hw/s390x/sclp.h | 1 +
> target/s390x/cpu.h | 76 ++++++++
> hw/s390x/cpu-topology.c | 4 +-
> target/s390x/kvm/kvm.c | 5 +-
> target/s390x/kvm/stsi-topology.c | 310 +++++++++++++++++++++++++++++++
> target/s390x/kvm/meson.build | 3 +-
> 9 files changed, 436 insertions(+), 3 deletions(-)
> create mode 100644 target/s390x/kvm/stsi-topology.c
[...]
> typedef struct S390Topology {
> uint8_t *cores_per_socket;
> + bool polarization;
You don't use this as a bool and since it's no longer called
vertical_polarization, it's not longer entirely clear what the value
means so I think this should be a CpuS390Polarization.
That also makes the assignment in patch 12 clearer since it assigns the
same type.
[...]
> S390Topology s390_topology = {
> /* will be initialized after the cpu model is realized */
> .cores_per_socket = NULL,
> + .polarization = S390_CPU_POLARIZATION_HORIZONTAL,
> };
[...]
> +static s390_topology_id s390_topology_from_cpu(S390CPU *cpu)
> +{
> + s390_topology_id topology_id = {0};
> +
> + topology_id.drawer = cpu->env.drawer_id;
> + topology_id.book = cpu->env.book_id;
> + topology_id.socket = cpu->env.socket_id;
> + topology_id.origin = cpu->env.core_id / 64;
> + topology_id.type = S390_TOPOLOGY_CPU_IFL;
> + topology_id.dedicated = cpu->env.dedicated;
> +
> + if (s390_topology.polarization == S390_CPU_POLARIZATION_VERTICAL) {
> + topology_id.entitlement = cpu->env.entitlement;
> + }
> +
> + return topology_id;
> +}
[...]