All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: qemu-s390x@nongnu.org
Cc: qemu-devel@nongnu.org, borntraeger@de.ibm.com,
	pasic@linux.ibm.com, richard.henderson@linaro.org,
	david@redhat.com, thuth@redhat.com, cohuck@redhat.com,
	mst@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org,
	ehabkost@redhat.com, marcel.apfelbaum@gmail.com,
	eblake@redhat.com, armbru@redhat.com, seiden@linux.ibm.com,
	nrb@linux.ibm.com, scgl@linux.ibm.com, frankja@linux.ibm.com,
	berrange@redhat.com, clg@kaod.org
Subject: [PATCH v12 7/7] docs/s390x: document s390x cpu topology
Date: Tue, 29 Nov 2022 18:42:06 +0100	[thread overview]
Message-ID: <20221129174206.84882-8-pmorel@linux.ibm.com> (raw)
In-Reply-To: <20221129174206.84882-1-pmorel@linux.ibm.com>

Add some basic examples for the definition of cpu topology
in s390x.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
 docs/system/s390x/cpu-topology.rst | 80 ++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 docs/system/s390x/cpu-topology.rst

diff --git a/docs/system/s390x/cpu-topology.rst b/docs/system/s390x/cpu-topology.rst
new file mode 100644
index 0000000000..2fad28453c
--- /dev/null
+++ b/docs/system/s390x/cpu-topology.rst
@@ -0,0 +1,80 @@
+CPU Topology on s390x
+=====================
+
+CPU Topology on S390x provides up to 5 levels of topology containers:
+nodes, drawers, books, sockets and CPUs.
+While the higher level containers, Containers Topology List Entries,
+(Containers TLE) define a tree hierarchy, the lowest level of topology
+definition, the CPU Topology List Entry (CPU TLE), provides the placement
+of the CPUs inside the parent container.
+
+Currently QEMU CPU topology uses a single level of container: the sockets.
+
+For backward compatibility, threads can be declared on the ``-smp`` command
+line. They will be seen as CPUs by the guest as long as multithreading
+is not really supported by QEMU for S390.
+
+Prerequisites
+-------------
+
+To use CPU Topology a Linux QEMU/KVM machine providing the CPU Topology facility
+(STFLE bit 11) is required.
+
+However, since this facility has been enabled by default in an early version
+of QEMU, we use a capability, ``KVM_CAP_S390_CPU_TOPOLOGY``, to notify KVM
+QEMU use of the CPU Topology.
+
+Indicating the CPU topology to the Virtual Machine
+--------------------------------------------------
+
+The CPU Topology, can be specified on the QEMU command line
+with the ``-smp`` or the ``-device`` QEMU command arguments.
+
+Like in :
+
+.. code-block:: sh
+    -smp cpus=5,sockets=8,cores=2,threads=2,maxcpus=32
+    -device host-s390x-cpu,core-id=14
+
+New CPUs can be plugged using the device_add hmp command like in:
+
+.. code-block:: sh
+   (qemu) device_add host-s390x-cpu,core-id=9
+
+The core-id defines the placement of the core in the topology by
+starting with core 0 in socket 0 up to maxcpus.
+
+In the example above:
+
+* There are 5 CPUs provided to the guest with the ``-smp`` command line
+  They will take the core-ids 0,1,2,3,4
+  As we have 2 threads in 2 cores in a socket, we have 4 CPUs provided
+  to the guest in socket 0, with core-ids 0,1,2,3.
+  The last cpu, with core-id 4, will be on socket 1.
+
+* the core with ID 14 provided by the ``-device`` command line will
+  be placed in socket 3, with core-id 14
+
+* the core with ID 9 provided by the ``device_add`` qmp command will
+  be placed in socket 2, with core-id 9
+
+Note that the core ID is machine wide and the CPU TLE masks provided
+by the STSI instruction will be:
+
+* in socket 0: 0xf0000000 (core id 0,1,2,3)
+* in socket 1: 0x00400000 (core id 9)
+* in socket 1: 0x00020000 (core id 14)
+
+Enabling CPU topology
+---------------------
+
+Currently, CPU topology is disabled by default.
+
+Enabling CPU topology can be done by setting the feature flag
+``disable-topology`` to ``off`` like in:
+
+.. code-block:: sh
+   -cpu gen16b,disable-topology=off
+
+Having the topology disabled by default allows migration between
+old and new QEMU without adding new flags.
-- 
2.31.1


  parent reply	other threads:[~2022-11-29 17:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 17:41 [PATCH v12 0/7] s390x: CPU Topology Pierre Morel
2022-11-29 17:42 ` [PATCH v12 1/7] s390x/cpu topology: Creating CPU topology device Pierre Morel
2022-12-01  9:08   ` Thomas Huth
2022-12-01  9:37     ` Pierre Morel
2022-12-06  9:31   ` Janis Schoetterl-Glausch
2022-12-06 10:32     ` Pierre Morel
2022-12-06 13:35       ` Janis Schoetterl-Glausch
2022-12-06 14:35         ` Pierre Morel
2022-12-06 21:06           ` Janis Schoetterl-Glausch
2022-12-07 10:00             ` Pierre Morel
2022-12-07 11:38               ` Janis Schoetterl-Glausch
2022-12-07 11:52                 ` Pierre Morel
2022-11-29 17:42 ` [PATCH v12 2/7] s390x/cpu topology: reporting the CPU topology to the guest Pierre Morel
2022-12-06  9:48   ` Janis Schoetterl-Glausch
2022-12-06 10:38     ` Pierre Morel
2022-12-06 14:44   ` Pierre Morel
2022-12-07  9:12   ` Cédric Le Goater
2022-12-07  9:58     ` Pierre Morel
2022-11-29 17:42 ` [PATCH v12 3/7] s390x/cpu_topology: resetting the Topology-Change-Report Pierre Morel
2022-12-06  9:50   ` Janis Schoetterl-Glausch
2022-12-06 11:51     ` Pierre Morel
2022-11-29 17:42 ` [PATCH v12 4/7] s390x/cpu_topology: CPU topology migration Pierre Morel
2022-11-29 17:42 ` [PATCH v12 5/7] s390x/cpu_topology: interception of PTF instruction Pierre Morel
2022-11-29 17:42 ` [PATCH v12 6/7] s390x/cpu_topology: activating CPU topology Pierre Morel
2022-12-01 10:15   ` Thomas Huth
2022-12-01 11:52     ` Pierre Morel
2022-12-02  9:05       ` Thomas Huth
2022-12-02 14:08         ` Pierre Morel
2022-12-02 14:26           ` Thomas Huth
2022-12-05 13:29             ` Pierre Morel
2022-11-29 17:42 ` Pierre Morel [this message]
2022-12-01  8:45 ` [PATCH v12 0/7] s390x: CPU Topology Cédric Le Goater
2022-12-01 13:23   ` Pierre Morel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221129174206.84882-8-pmorel@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=clg@kaod.org \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=nrb@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=scgl@linux.ibm.com \
    --cc=seiden@linux.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.