From: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
To: Pierre Morel <pmorel@linux.ibm.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, 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, frankja@linux.ibm.com
Subject: Re: [PATCH v9 06/10] s390x/cpu_topology: resetting the Topology-Change-Report
Date: Thu, 08 Sep 2022 09:57:18 +0200 [thread overview]
Message-ID: <2ced62d89af99358d3d6d8d89e2faf8b115e8509.camel@linux.ibm.com> (raw)
In-Reply-To: <20220902075531.188916-7-pmorel@linux.ibm.com>
On Fri, 2022-09-02 at 09:55 +0200, Pierre Morel wrote:
> During a subsystem reset the Topology-Change-Report is cleared
> by the machine.
> Let's ask KVM to clear the Modified Topology Change Report (MTCR)
> bit of the SCA in the case of a subsystem reset.
>
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> ---
> hw/s390x/cpu-topology.c | 12 ++++++++++++
> hw/s390x/s390-virtio-ccw.c | 1 +
> target/s390x/cpu-sysemu.c | 7 +++++++
> target/s390x/cpu.h | 1 +
> target/s390x/kvm/kvm.c | 23 +++++++++++++++++++++++
> target/s390x/kvm/kvm_s390x.h | 1 +
> 6 files changed, 45 insertions(+)
[...]
> diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
> index f96630440b..9c994d27d5 100644
> --- a/target/s390x/kvm/kvm.c
> +++ b/target/s390x/kvm/kvm.c
> @@ -2585,3 +2585,26 @@ int kvm_s390_get_zpci_op(void)
> {
> return cap_zpci_op;
> }
> +
> +int kvm_s390_topology_set_mtcr(uint64_t attr)
> +{
> + struct kvm_device_attr attribute = {
> + .group = KVM_S390_VM_CPU_TOPOLOGY,
> + .attr = attr,
> + };
> + int ret;
> +
> + if (!s390_has_feat(S390_FEAT_CONFIGURATION_TOPOLOGY)) {
> + return -EFAULT;
Why EFAULT?
The return value is just ignored when resetting, isn't it?
I wonder if it would be better not to.
Is it necessary because you're detecting the feature after you've
already created the S390Topology instance?
And you're doing that because that's just the order in which QEMU does
things? So the machine class is inited before the cpu model?
I wonder if there is a nice way to create the S390Topology only if the
feature is selected.
Anyway:
Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
> + }
> + if (!kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_TOPOLOGY, attr)) {
> + return -ENOENT;
> + }
> +
> + ret = kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attribute);
> + if (ret) {
> + error_report("Failed to set cpu topology attribute %lu: %s",
> + attr, strerror(-ret));
> + }
> + return ret;
> +}
>
[...]
next prev parent reply other threads:[~2022-09-08 7:58 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 7:55 [PATCH v9 00/10] s390x: CPU Topology Pierre Morel
2022-09-02 7:55 ` [PATCH v9 01/10] s390x/cpus: Make absence of multithreading clear Pierre Morel
2022-09-05 11:32 ` Nico Boehr
2022-09-05 15:10 ` Pierre Morel
2022-09-05 15:23 ` Janis Schoetterl-Glausch
2022-09-05 15:42 ` Pierre Morel
2022-09-27 9:44 ` Cédric Le Goater
2022-09-28 13:21 ` Pierre Morel
2022-09-28 16:16 ` Pierre Morel
2022-09-28 16:28 ` Cédric Le Goater
2022-10-11 7:21 ` Pierre Morel
2022-10-11 7:28 ` Cédric Le Goater
2022-09-28 18:11 ` Daniel P. Berrangé
2022-10-10 17:20 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 02/10] s390x/cpu topology: core_id sets s390x CPU topology Pierre Morel
2022-09-05 18:11 ` Janis Schoetterl-Glausch
2022-09-12 15:34 ` Pierre Morel
2022-09-06 5:58 ` Nico Boehr
2022-09-12 15:40 ` Pierre Morel
2022-09-27 12:03 ` Cédric Le Goater
2022-09-28 13:15 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 03/10] s390x/cpu topology: reporting the CPU topology to the guest Pierre Morel
2022-09-06 8:17 ` Nico Boehr
2022-09-28 10:03 ` Pierre Morel
2022-09-06 11:49 ` Janis Schoetterl-Glausch
2022-09-28 10:01 ` Pierre Morel
2022-09-07 10:26 ` Janis Schoetterl-Glausch
2022-09-28 9:07 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 04/10] hw/core: introducing drawer and books for s390x Pierre Morel
2022-09-06 8:59 ` Markus Armbruster
2022-09-28 9:04 ` Pierre Morel
2022-09-28 9:06 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 05/10] s390x/cpu: reporting drawers and books topology to the guest Pierre Morel
2022-09-07 10:36 ` Janis Schoetterl-Glausch
2022-09-28 8:55 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 06/10] s390x/cpu_topology: resetting the Topology-Change-Report Pierre Morel
2022-09-06 8:27 ` Nico Boehr
2022-09-28 8:35 ` Pierre Morel
2022-09-08 7:57 ` Janis Schoetterl-Glausch [this message]
2022-09-28 8:46 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 07/10] s390x/cpu_topology: CPU topology migration Pierre Morel
2022-09-08 18:04 ` Janis Schoetterl-Glausch
2022-09-28 8:34 ` Pierre Morel
2022-09-29 17:30 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 08/10] target/s390x: interception of PTF instruction Pierre Morel
2022-09-09 16:50 ` Janis Schoetterl-Glausch
2022-09-28 13:34 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 09/10] s390x/cpu_topology: activating CPU topology Pierre Morel
2022-09-05 15:29 ` Pierre Morel
2022-09-27 14:41 ` Cédric Le Goater
2022-09-28 8:15 ` Pierre Morel
2022-09-02 7:55 ` [PATCH v9 10/10] docs/s390x: document s390x cpu topology Pierre Morel
2022-09-12 13:41 ` Janis Schoetterl-Glausch
2022-09-28 8:19 ` Pierre Morel
2022-09-12 13:48 ` Janis Schoetterl-Glausch
2022-09-12 14:38 ` [PATCH v9 00/10] s390x: CPU Topology Janis Schoetterl-Glausch
2022-09-28 8:28 ` Pierre Morel
2022-11-16 16:51 ` Christian Borntraeger
2022-11-17 9:31 ` Pierre Morel
2022-11-17 16:38 ` Pierre Morel
2022-11-24 9:25 ` Pierre Morel
2022-11-27 10:50 ` 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=2ced62d89af99358d3d6d8d89e2faf8b115e8509.camel@linux.ibm.com \
--to=scgl@linux.ibm.com \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--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=pmorel@linux.ibm.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).