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: Pierre Morel
Subject: Re: [PATCH v9 03/10] s390x/cpu topology: reporting the CPU topology to the guest
Date: Wed, 28 Sep 2022 11:07:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1



On 9/7/22 12:26, Janis Schoetterl-Glausch wrote:
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.


right,

Thanks,
Pierre


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

--
Pierre Morel
IBM Lab Boeblingen



reply via email to

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