[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v23 03/20] target/s390x/cpu topology: handle STSI(15) and bui
From: |
Nina Schoetterl-Glausch |
Subject: |
Re: [PATCH v23 03/20] target/s390x/cpu topology: handle STSI(15) and build the SYSIB |
Date: |
Tue, 19 Sep 2023 15:37:11 +0200 |
User-agent: |
Evolution 3.48.4 (3.48.4-1.fc38) |
On Thu, 2023-09-14 at 14:06 +0200, Nina Schoetterl-Glausch wrote:
> From: Pierre Morel <pmorel@linux.ibm.com>
>
> 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 <pmorel@linux.ibm.com>
> Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> ---
> MAINTAINERS | 1 +
> qapi/machine-target.json | 14 ++
> include/hw/s390x/cpu-topology.h | 23 +++
> include/hw/s390x/sclp.h | 1 +
> target/s390x/cpu.h | 75 +++++++
> hw/s390x/cpu-topology.c | 2 +
> target/s390x/kvm/kvm.c | 5 +-
> target/s390x/kvm/stsi-topology.c | 338 +++++++++++++++++++++++++++++++
> target/s390x/kvm/meson.build | 3 +-
> 9 files changed, 460 insertions(+), 2 deletions(-)
> create mode 100644 target/s390x/kvm/stsi-topology.c
[...]
> diff --git a/target/s390x/kvm/stsi-topology.c
> b/target/s390x/kvm/stsi-topology.c
> new file mode 100644
> index 0000000000..22bac2b834
> --- /dev/null
> +++ b/target/s390x/kvm/stsi-topology.c
[...]
> +/**
> + * s390_topology_id_cmp:
> + * @l: first s390_topology_id
> + * @r: second s390_topology_id
> + *
> + * Compare two topology ids according to the sorting order specified by the
> PoP.
> + *
> + * Returns a negative number if the first id is less than, 0 if it is equal
> to
> + * and positive if it is larger than the second id.
> + */
> +static int s390_topology_id_cmp(const s390_topology_id *l,
> + const s390_topology_id *r)
> +{
> + /*
> + * lexical order, compare less significant values only if more
> significant
> + * ones are equal
> + */
> + return l->sentinel - r->sentinel ?:
> + l->drawer - r->drawer ?:
> + l->book - r->book ?:
> + l->socket - r->socket ?:
> + l->type - r->type ?:
> + -1 * (l->vertical - r->vertical) ?:
> + -1 * (l->entitlement - r->entitlement) ?:
> + -1 * (l->dedicated - r->dedicated) ?:
I'll switch around those expressions manually, since gcc complains:
error: ‘*’ in boolean context, suggest ‘&&’ instead
[-Werror=int-in-bool-context]
222 | -1 * (l->vertical - r->vertical) ?:
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I'll add a comment also, since the inverted logic is not as obvious as before.
> + l->origin - r->origin;
> +}
[...]
- [PATCH v23 00/20] s390x: CPU Topology, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 07/20] target/s390x/cpu topology: activate CPU topology, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 16/20] tests/avocado: s390x cpu topology entitlement tests, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 19/20] tests/avocado: s390x cpu topology dedicated errors, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 03/20] target/s390x/cpu topology: handle STSI(15) and build the SYSIB, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 12/20] qapi/s390x/cpu topology: query-cpu-polarization qmp command, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 18/20] tests/avocado: s390x cpu topology test socket full, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 06/20] s390x/cpu topology: interception of PTF instruction, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 09/20] machine: adding s390 topology to query-cpu-fast, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 05/20] s390x/cpu topology: resetting the Topology-Change-Report, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 14/20] tests/avocado: s390x cpu topology core, Nina Schoetterl-Glausch, 2023/09/14
- [PATCH v23 17/20] tests/avocado: s390x cpu topology test dedicated CPU, Nina Schoetterl-Glausch, 2023/09/14