On Thu, 2023-01-05 at 15:53 +0100, Pierre Morel wrote:
> S390 adds two new SMP levels, drawers and books to the CPU
> topology.
> The S390 CPU have specific toplogy features like dedication
> and polarity to give to the guest indications on the host
> vCPUs scheduling and help the guest take the best decisions
> on the scheduling of threads on the vCPUs.
>
> Let us provide the SMP properties with books and drawers levels
> and S390 CPU with dedication and polarity,
>
> Signed-off-by: Pierre Morel <[email protected]>
> ---
> qapi/machine.json | 14 ++++++++--
> include/hw/boards.h | 10 ++++++-
> include/hw/s390x/cpu-topology.h | 23 ++++++++++++++++
> target/s390x/cpu.h | 6 +++++
> hw/core/machine-smp.c | 48 ++++++++++++++++++++++++++++-----
> hw/core/machine.c | 4 +++
> hw/s390x/s390-virtio-ccw.c | 2 ++
> softmmu/vl.c | 6 +++++
> target/s390x/cpu.c | 10 +++++++
> qemu-options.hx | 6 +++--
> 10 files changed, 117 insertions(+), 12 deletions(-)
> create mode 100644 include/hw/s390x/cpu-topology.h
>
[...]
> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
> index 7d6d01325b..39ea63a416 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -131,6 +131,12 @@ struct CPUArchState {
>
> #if !defined(CONFIG_USER_ONLY)
> uint32_t core_id; /* PoP "CPU address", same as cpu_index */
> + int32_t socket_id;
> + int32_t book_id;
> + int32_t drawer_id;
> + int32_t dedicated;
> + int32_t polarity;
If I understood the architecture correctly, the polarity is a property of the
configuration,
not the cpus. So this should be vertical_entitlement, and there should be a
machine (?) property
specifying if the polarity is horizontal or vertical.
> + int32_t cpu_type;
> uint64_t cpuid;
> #endif
>
[...]