qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>, qemu-s390x@nongnu.org
Cc: qemu-devel@nongnu.org, borntraeger@de.ibm.com,
	pasic@linux.ibm.com, richard.henderson@linaro.org,
	david@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, nsg@linux.ibm.com,
	frankja@linux.ibm.com, berrange@redhat.com, clg@kaod.org
Subject: Re: [PATCH v16 00/11] s390x: CPU Topology
Date: Mon, 27 Feb 2023 15:20:58 +0100	[thread overview]
Message-ID: <7cd54252-3d58-10c8-6aae-f620ff83c8cb@linux.ibm.com> (raw)
In-Reply-To: <c41ca0c4-3e38-1afa-f113-9f5cb5313995@redhat.com>


On 2/27/23 15:00, Thomas Huth wrote:
> On 22/02/2023 15.20, Pierre Morel wrote:
>> Hi,
>>
>> No big changes here, some bug corrections and comments modifications
>> following Thomas and Nina comments and Daniel and Markus reommandations.
>>
>> Implementation discussions
>> ==========================
>>
>> CPU models
>> ----------
>>
>> Since the facility 11, S390_FEAT_CONFIGURATION_TOPOLOGY is already
>> in the CPU model for old QEMU we could not activate it as usual from
>> KVM but needed a KVM capability: KVM_CAP_S390_CPU_TOPOLOGY.
>> Checking and enabling this capability enables facility 11,
>> S390_FEAT_CONFIGURATION_TOPOLOGY.
>>
>> It is the responsibility of the admin to ensure the same CPU
>> model for source and target host in a migration.
>>
>> Migration
>> ---------
>>
>> When the target guest is started, the Multi-processor Topology Change
>> Report (MTCR) bit is set during the creation of the vCPU by KVM.
>> We do not need to migrate its state, in the worst case, the target
>> guest will see the MTCR and actualize its view of the topology
>> without necessity, but this will be done only one time.
>>
>> Reset
>> -----
>>
>> Reseting the topology is done during subsystem reset, the
>> polarization is reset to horizontal polarization.
>>
>> Topology attributes
>> -------------------
>>
>> The topology attributes are carried by the CPU object and defined
>> on object creation.
>> In the case the new attributes, socket, book, drawer, dedicated,
>> polarity are not provided QEMU provides defaults values.
>>
>> - Geometry defaults
>>    The geometry default are based on the core-id of the core to
>>    fill the geometry in a monotone way starting with drawer 0,
>>    book 0, and filling socket 0 with the number of cores per socket,
>>    then filling socket 1, socket 2 ... etc until the book is complete
>>    and all books until the first drawer is complete before starting with
>>    the next drawer.
>>
>>    This allows to keep existing start scripts and Libvirt existing
>>    interface until it is extended.
>>
>> - Modifiers defaults
>>    Default polarization is horizontal
>>    Default dedication is not dedicated.
>>
>> Dynamic topology modification
>> -----------------------------
>>
>> QAPI interface is extended with:
>> - a command: 'x-set-cpu-topology'
>> - a query: extension of 'query-cpus-fast'
>> - an event: 'CPU_POLARITY_CHANGE'
>>
>> The admin may use query-cpus-fast to verify the topology provided
>> to the guest and x-set-cpu-topology to modify it.
>>
>> The event CPU_POLARITY_CHANGE is sent when the guest successfuly
>> uses the PTF(2) instruction to request a polarization change.
>> In that case, the admin is supposed to modify the CPU provisioning
>> accordingly.
>>
>> Testing
>> =======
>>
>> To use the QEMU patches, you will need Linux V6-rc1 or newer,
>> or use the following Linux mainline patches:
>>
>> f5ecfee94493 2022-07-20 KVM: s390: resetting the Topology-Change-Report
>> 24fe0195bc19 2022-07-20 KVM: s390: guest support for topology function
>> 0130337ec45b 2022-07-20 KVM: s390: Cleanup ipte lock access and SIIF 
>> fac..
>>
>> Currently this code is for KVM only, I have no idea if it is interesting
>> to provide a TCG patch. If ever it will be done in another series.
>>
>> Documentation
>> =============
>>
>> To have a better understanding of the S390x CPU Topology and its
>> implementation in QEMU you can have a look at the documentation in the
>> last patch of this series.
>>
>> The admin will want to match the host and the guest topology, taking
>> into account that the guest does not recognize multithreading.
>> Consequently, two vCPU assigned to threads of the same real CPU should
>> preferably be assigned to the same socket of the guest machine.
>>
>>
>> Regards,
>> Pierre
>>
>> Pierre Morel (11):
>>    s390x/cpu topology: add s390 specifics to CPU topology
>>    s390x/cpu topology: add topology entries on CPU hotplug
>>    target/s390x/cpu topology: handle STSI(15) and build the SYSIB
>>    s390x/sclp: reporting the maximum nested topology entries
>>    s390x/cpu topology: resetting the Topology-Change-Report
>>    s390x/cpu topology: interception of PTF instruction
>>    target/s390x/cpu topology: activating CPU topology
>>    qapi/s390x/cpu topology: set-cpu-topology monitor command
>>    machine: adding s390 topology to query-cpu-fast
>>    qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE qapi event
>>    docs/s390x/cpu topology: document s390x cpu topology
>>
>>   docs/system/s390x/cpu-topology.rst | 378 ++++++++++++++++++++
>>   docs/system/target-s390x.rst       |   1 +
>>   qapi/machine-target.json           |  81 +++++
>>   qapi/machine.json                  |  37 +-
>>   include/hw/boards.h                |  10 +-
>>   include/hw/s390x/cpu-topology.h    |  78 +++++
>>   include/hw/s390x/s390-virtio-ccw.h |   6 +
>>   include/hw/s390x/sclp.h            |   4 +-
>>   include/monitor/hmp.h              |   1 +
>>   target/s390x/cpu.h                 |  78 +++++
>>   target/s390x/kvm/kvm_s390x.h       |   1 +
>>   hw/core/machine-qmp-cmds.c         |   2 +
>>   hw/core/machine-smp.c              |  48 ++-
>>   hw/core/machine.c                  |   4 +
>>   hw/s390x/cpu-topology.c            | 534 +++++++++++++++++++++++++++++
>>   hw/s390x/s390-virtio-ccw.c         |  27 +-
>>   hw/s390x/sclp.c                    |   5 +
>>   softmmu/vl.c                       |   6 +
>>   target/s390x/cpu-sysemu.c          |  13 +
>>   target/s390x/cpu.c                 |   7 +
>>   target/s390x/cpu_models.c          |   1 +
>>   target/s390x/kvm/cpu_topology.c    | 312 +++++++++++++++++
>>   target/s390x/kvm/kvm.c             |  42 ++-
>>   hmp-commands.hx                    |  17 +
>>   hw/s390x/meson.build               |   1 +
>>   qemu-options.hx                    |   7 +-
>>   target/s390x/kvm/meson.build       |   3 +-
>>   27 files changed, 1685 insertions(+), 19 deletions(-)
>>   create mode 100644 docs/system/s390x/cpu-topology.rst
>>   create mode 100644 include/hw/s390x/cpu-topology.h
>>   create mode 100644 hw/s390x/cpu-topology.c
>>   create mode 100644 target/s390x/kvm/cpu_topology.c
>
> Any chance that you could also add some qtests for checking that the 
> topology works as expected? I.e. set some topology via the command 
> line, then use QMP to check whether all CPUs got the right settings?
>
>  Thomas
>
Yes I intend to develop some tests but it will take some time to develop 
it I need to do change of polarization from inside the guest and qmp 
from the host.

Regards,

Pierre





      reply	other threads:[~2023-02-27 14:28 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 14:20 [PATCH v16 00/11] s390x: CPU Topology Pierre Morel
2023-02-22 14:20 ` [PATCH v16 01/11] s390x/cpu topology: add s390 specifics to CPU topology Pierre Morel
2023-02-22 14:20 ` [PATCH v16 02/11] s390x/cpu topology: add topology entries on CPU hotplug Pierre Morel
2023-02-23 12:53   ` Thomas Huth
2023-02-23 14:06     ` pierre
2023-02-23 14:13       ` Nina Schoetterl-Glausch
2023-02-23 14:35         ` pierre
2023-02-22 14:20 ` [PATCH v16 03/11] target/s390x/cpu topology: handle STSI(15) and build the SYSIB Pierre Morel
2023-02-23 13:30   ` Thomas Huth
2023-02-23 14:27     ` pierre
2023-02-27 13:21   ` Nina Schoetterl-Glausch
2023-03-08 15:24     ` Pierre Morel
2023-02-22 14:20 ` [PATCH v16 04/11] s390x/sclp: reporting the maximum nested topology entries Pierre Morel
2023-02-22 14:20 ` [PATCH v16 05/11] s390x/cpu topology: resetting the Topology-Change-Report Pierre Morel
2023-02-22 14:21 ` [PATCH v16 06/11] s390x/cpu topology: interception of PTF instruction Pierre Morel
2023-02-27 12:39   ` Thomas Huth
2023-02-27 14:12     ` Pierre Morel
2023-02-22 14:21 ` [PATCH v16 07/11] target/s390x/cpu topology: activating CPU topology Pierre Morel
2023-02-27 13:26   ` Thomas Huth
2023-02-27 14:13     ` Pierre Morel
2023-02-22 14:21 ` [PATCH v16 08/11] qapi/s390x/cpu topology: set-cpu-topology monitor command Pierre Morel
2023-02-24 17:15   ` Nina Schoetterl-Glausch
2023-02-27  7:59     ` Thomas Huth
2023-02-27 10:49       ` Nina Schoetterl-Glausch
2023-02-27 12:25         ` Markus Armbruster
2023-02-27 12:51           ` Nina Schoetterl-Glausch
2023-02-27 15:34             ` Markus Armbruster
2023-02-27 10:57     ` Pierre Morel
2023-02-27 11:26       ` Thomas Huth
2023-02-27 12:15       ` Nina Schoetterl-Glausch
2023-02-27 14:11         ` Pierre Morel
2023-03-02 15:00     ` Pierre Morel
2023-02-27  8:26   ` Pierre Morel
2023-02-27  8:52     ` [PATCH v17 08/12] " Pierre Morel
2023-02-27  8:52       ` [PATCH v17 12/12] machine: adding s390 topology to info hotpluggable-cpus Pierre Morel
2023-02-22 14:21 ` [PATCH v16 09/11] machine: adding s390 topology to query-cpu-fast Pierre Morel
2023-02-27 13:27   ` Thomas Huth
2023-02-27 14:13     ` Pierre Morel
2023-02-22 14:21 ` [PATCH v16 10/11] qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE qapi event Pierre Morel
2023-02-27 13:32   ` Thomas Huth
2023-02-27 14:14     ` Pierre Morel
2023-02-22 14:21 ` [PATCH v16 11/11] docs/s390x/cpu topology: document s390x cpu topology Pierre Morel
2023-02-27 13:58   ` Thomas Huth
2023-02-27 14:17     ` Pierre Morel
2023-02-27 14:27       ` Thomas Huth
2023-02-27 17:34         ` Pierre Morel
2023-03-01 15:52   ` Nina Schoetterl-Glausch
2023-03-02  8:58     ` Pierre Morel
2023-02-27 14:00 ` [PATCH v16 00/11] s390x: CPU Topology Thomas Huth
2023-02-27 14:20   ` Pierre Morel [this message]

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=7cd54252-3d58-10c8-6aae-f620ff83c8cb@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=nsg@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).