qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9 03/10] s390x/cpu topology: reporting the CPU topology to t


From: Janis Schoetterl-Glausch
Subject: Re: [PATCH v9 03/10] s390x/cpu topology: reporting the CPU topology to the guest
Date: Wed, 07 Sep 2022 12:26:54 +0200
User-agent: Evolution 3.42.4 (3.42.4-2.fc35)

On Fri, 2022-09-02 at 09:55 +0200, Pierre Morel wrote:
> The guest can use the STSI instruction to get a buffer filled
> with the CPU topology description.
> 
> Let us implement the STSI instruction for the basis CPU topology
> level, level 2.
> 
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> ---
>  hw/s390x/cpu-topology.c         |   4 ++
>  include/hw/s390x/cpu-topology.h |   5 ++
>  target/s390x/cpu.h              |  49 +++++++++++++++
>  target/s390x/cpu_topology.c     | 108 ++++++++++++++++++++++++++++++++
>  target/s390x/kvm/kvm.c          |   6 +-
>  target/s390x/meson.build        |   1 +
>  6 files changed, 172 insertions(+), 1 deletion(-)
>  create mode 100644 target/s390x/cpu_topology.c
> 
[...]

> diff --git a/target/s390x/cpu_topology.c b/target/s390x/cpu_topology.c

[...]

> +static char *fill_tle_cpu(char *p, uint64_t mask, int origin)
> +{
> +    SysIBTl_cpu *tle = (SysIBTl_cpu *)p;
> +
> +    tle->nl = 0;
> +    tle->dedicated = 1;
> +    tle->polarity = S390_TOPOLOGY_POLARITY_H;
> +    tle->type = S390_TOPOLOGY_CPU_TYPE;
> +    tle->origin = origin * 64;

origin is a multibyte field too, so needs a conversion too.

> +    tle->mask = be64_to_cpu(mask);
> +    return p + sizeof(*tle);
> +}
> +
[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]