All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
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>,
	<berrange@redhat.com>
Subject: Re: [PATCH v10 7/9] s390x/cpu topology: add max_threads machine class attribute
Date: Tue, 18 Oct 2022 19:36:07 +0200	[thread overview]
Message-ID: <b52ea256-c6c1-51ef-6e15-78a303143701@kaod.org> (raw)
In-Reply-To: <20221012162107.91734-8-pmorel@linux.ibm.com>

On 10/12/22 18:21, Pierre Morel wrote:
> The S390 CPU topology accepts the smp.threads argument while
> in reality it does not effectively allow multthreading.
> 
> Let's keep this behavior for machines older than 7.3 and
> refuse to use threads in newer machines until multithreading
> is really proposed to the guest by the machine.
> 
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> ---
>   include/hw/s390x/s390-virtio-ccw.h |  1 +
>   hw/s390x/s390-virtio-ccw.c         | 10 ++++++++++
>   2 files changed, 11 insertions(+)
> 
> diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h
> index 6c4b4645fc..319dfac1bb 100644
> --- a/include/hw/s390x/s390-virtio-ccw.h
> +++ b/include/hw/s390x/s390-virtio-ccw.h
> @@ -48,6 +48,7 @@ struct S390CcwMachineClass {
>       bool css_migration_enabled;
>       bool hpage_1m_allowed;
>       bool topology_allowed;
> +    int max_threads;
>   };
>   
>   /* runtime-instrumentation allowed by the machine */
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 3a13fad4df..d6ce31d168 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -85,8 +85,15 @@ out:
>   static void s390_init_cpus(MachineState *machine)
>   {
>       MachineClass *mc = MACHINE_GET_CLASS(machine);
> +    S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc);
>       int i;
>   
> +    if (machine->smp.threads > s390mc->max_threads) {
> +        error_report("S390 does not support more than %d threads.",
> +                     s390mc->max_threads);
> +        exit(1);
> +    }
> +
>       /* initialize possible_cpus */
>       mc->possible_cpu_arch_ids(machine);
>   
> @@ -617,6 +624,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
>       s390mc->css_migration_enabled = true;
>       s390mc->hpage_1m_allowed = true;
>       s390mc->topology_allowed = true;
> +    s390mc->max_threads = 1;
>       mc->init = ccw_init;
>       mc->reset = s390_machine_reset;
>       mc->block_default_type = IF_VIRTIO;
> @@ -887,12 +895,14 @@ static void ccw_machine_7_2_class_options(MachineClass *mc)
>       S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc);
>       static GlobalProperty compat[] = {
>           { TYPE_S390_CPU_TOPOLOGY, "topology-allowed", "off", },
> +        { TYPE_S390_CPU_TOPOLOGY, "max_threads", "off", },

I don't understand this change.


C.


>       };
>   
>       ccw_machine_7_3_class_options(mc);
>       compat_props_add(mc->compat_props, hw_compat_7_2, hw_compat_7_2_len);
>       compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
>       s390mc->topology_allowed = false;
> +    s390mc->max_threads = S390_MAX_CPUS;
>   }
>   DEFINE_CCW_MACHINE(7_2, "7.2", false);
>   


  reply	other threads:[~2022-10-18 17:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 16:20 [PATCH v10 0/9] s390x: CPU Topology Pierre Morel
2022-10-12 16:20 ` [PATCH v10 1/9] s390x/cpu topology: core_id sets s390x CPU topology Pierre Morel
2022-10-18 16:43   ` Cédric Le Goater
2022-10-19 15:39     ` Pierre Morel
2022-10-19 17:56       ` Janis Schoetterl-Glausch
2022-10-24  9:22       ` Cédric Le Goater
2022-10-24 19:26       ` Janis Schoetterl-Glausch
2022-10-24 19:25   ` Janis Schoetterl-Glausch
2022-10-27  8:05     ` Thomas Huth
2022-10-27  9:13       ` Janis Schoetterl-Glausch
2022-10-25 19:58   ` Janis Schoetterl-Glausch
2022-10-26  8:34     ` Pierre Morel
2022-10-27 20:20       ` Janis Schoetterl-Glausch
2022-10-28  9:30         ` Pierre Morel
2022-11-07 18:04           ` Janis Schoetterl-Glausch
2022-11-08 10:28             ` Pierre Morel
2022-10-12 16:21 ` [PATCH v10 2/9] s390x/cpu topology: reporting the CPU topology to the guest Pierre Morel
2022-10-18 17:10   ` Cédric Le Goater
2022-10-27  8:12   ` Thomas Huth
2022-10-27 11:24     ` Pierre Morel
2022-10-27 20:42   ` Janis Schoetterl-Glausch
2022-10-28 10:00     ` Pierre Morel
2022-11-07 13:20       ` Janis Schoetterl-Glausch
2022-11-07 13:57         ` Pierre Morel
2022-10-12 16:21 ` [PATCH v10 3/9] s390x/cpu_topology: resetting the Topology-Change-Report Pierre Morel
2022-10-18 17:19   ` Cédric Le Goater
2022-10-27  8:14   ` Thomas Huth
2022-10-27  9:11     ` Pierre Morel
2022-10-27  9:58       ` Cédric Le Goater
2022-10-27 11:26         ` Pierre Morel
2022-10-12 16:21 ` [PATCH v10 4/9] s390x/cpu_topology: CPU topology migration Pierre Morel
2022-10-12 16:21 ` [PATCH v10 5/9] target/s390x: interception of PTF instruction Pierre Morel
2022-10-12 16:21 ` [PATCH v10 6/9] s390x/cpu topology: add topology-disable machine property Pierre Morel
2022-10-18 17:34   ` Cédric Le Goater
2022-10-19  9:03     ` Cornelia Huck
2022-10-19 15:48       ` Pierre Morel
2022-10-20 14:01     ` Pierre Morel
2022-10-18 17:51   ` Cédric Le Goater
2022-10-20 14:32     ` Pierre Morel
2022-10-12 16:21 ` [PATCH v10 7/9] s390x/cpu topology: add max_threads machine class attribute Pierre Morel
2022-10-18 17:36   ` Cédric Le Goater [this message]
2022-10-26  9:04     ` Pierre Morel
2022-10-27 10:00   ` Cédric Le Goater
2022-10-27 11:28     ` Pierre Morel
2022-10-12 16:21 ` [PATCH v10 8/9] s390x/cpu_topology: activating CPU topology Pierre Morel
2022-10-12 16:21 ` [PATCH v10 9/9] docs/s390x: document s390x cpu topology 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=b52ea256-c6c1-51ef-6e15-78a303143701@kaod.org \
    --to=clg@kaod.org \
    --cc=armbru@redhat.com \
    --cc=berrange@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 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.