qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>, qemu-s390x@nongnu.org
Cc: thuth@redhat.com, ehabkost@redhat.com, david@redhat.com,
	richard.henderson@linaro.org, qemu-devel@nongnu.org,
	armbru@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com,
	pbonzini@redhat.com, eblake@redhat.com
Subject: Re: [PATCH v1 1/9] s390x: smp: s390x dedicated smp parsing
Date: Fri, 16 Jul 2021 12:47:14 +0200	[thread overview]
Message-ID: <fb7beb44-4a25-8ebf-2bd9-be7e4ca15a1a@linux.ibm.com> (raw)
In-Reply-To: <871r7yd4gf.fsf@redhat.com>



On 7/16/21 10:54 AM, Cornelia Huck wrote:
> On Wed, Jul 14 2021, Pierre Morel <pmorel@linux.ibm.com> wrote:
> 
>> We need a s390x dedicated SMP parsing to handle s390x specificities.
>>
>> In this patch we only handle threads, cores and sockets for
>> s390x:
>> - do not support threads, we always have 1 single thread per core
>> - the sockets are filled one after the other with the cores
>>
>> Both these handlings are different from the standard smp_parse
>> functionement and reflect the CPU topology in the simple case
>> where all CPU belong to the same book.
>>
>> Topology levels above sockets, i.e. books, drawers, are not
>> considered at this stage and will be introduced in a later patch.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
>>   hw/s390x/s390-virtio-ccw.c | 42 ++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 42 insertions(+)
>>
>> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
>> index e4b18aef49..899d3a4137 100644
>> --- a/hw/s390x/s390-virtio-ccw.c
>> +++ b/hw/s390x/s390-virtio-ccw.c
>> @@ -582,6 +582,47 @@ static ram_addr_t s390_fixup_ram_size(ram_addr_t sz)
>>       return newsz;
>>   }
>>   
>> +/*
>> + * In S390CCW machine we do not support threads for now,
>> + * only sockets and cores.
>> + */
>> +static void s390_smp_parse(MachineState *ms, QemuOpts *opts)
> 
> It seems you based this on an older version of the code? The current
> signature of this function since 1e63fe685804 ("machine: pass QAPI
> struct to mc->smp_parse") is
> 
> void (*smp_parse)(MachineState *ms, SMPConfiguration *config, Error **errp);
> 
> That affects your parsing, and also lets you get rid of the ugly exit(1)
> statements.

hum, yes, thanks

> 
>> +{
>> +    unsigned cpus    = qemu_opt_get_number(opts, "cpus", 1);
>> +    unsigned sockets = qemu_opt_get_number(opts, "sockets", 1);
>> +    unsigned cores   = qemu_opt_get_number(opts, "cores", 1);
>> +
>> +    if (opts) {
>> +        if (cpus == 0 || sockets == 0 || cores == 0) {
> 
> This behaviour looks different from what we do for other targets: if you
> specify the value as 0, a value is calculated from the other values;
> here, you error out. It's probably not a good idea to differ.

right, thanks

> 
>> +            error_report("cpu topology: "
>> +                         "sockets (%u), cores (%u) or number of CPU(%u) "
>> +                         "can not be zero", sockets, cores, cpus);
>> +            exit(1);
>> +        }
>> +    }
>> +
> 

-- 
Pierre Morel
IBM Lab Boeblingen


  parent reply	other threads:[~2021-07-16 10:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 16:53 [PATCH v1 0/9] s390x: CPU Topology Pierre Morel
2021-07-14 16:53 ` [PATCH v1 1/9] s390x: smp: s390x dedicated smp parsing Pierre Morel
2021-07-16  8:54   ` Cornelia Huck
2021-07-16  9:14     ` Daniel P. Berrangé
2021-07-16 10:59       ` Pierre Morel
     [not found]       ` <e4865ad6-f8ec-e7ba-66ef-9c95334ba9b3@linux.ibm.com>
2021-07-19 15:43         ` Cornelia Huck
2021-07-19 15:52           ` Daniel P. Berrangé
2021-07-20  7:37             ` Pierre Morel
2021-07-20  8:33               ` Pierre Morel
2021-07-16 10:47     ` Pierre Morel [this message]
2021-07-14 16:53 ` [PATCH v1 2/9] s390x: toplogy: adding drawers and books to " Pierre Morel
2021-07-15  6:16   ` Markus Armbruster
2021-07-15  8:19     ` Pierre Morel
2021-07-15 10:48       ` Markus Armbruster
2021-07-16  9:10         ` Cornelia Huck
2021-07-16  9:18           ` Daniel P. Berrangé
2021-07-16 10:44             ` Cornelia Huck
2021-07-16 10:49               ` Daniel P. Berrangé
2021-07-19 15:50                 ` Cornelia Huck
2021-07-20  7:52                   ` Pierre Morel
2021-07-20  8:20                     ` Cornelia Huck
2021-07-20  8:46                       ` Pierre Morel
2021-07-20  9:00                         ` Cornelia Huck
2021-07-20  9:19                         ` Daniel P. Berrangé
2021-07-20 12:29                           ` Pierre Morel
2021-07-16  9:23     ` Daniel P. Berrangé
2021-07-16 11:08       ` Pierre Morel
2021-07-14 16:53 ` [PATCH v1 3/9] s390x: cpu topology: CPU topology objects and structures Pierre Morel
2021-07-14 16:53 ` [PATCH v1 4/9] s390x: Topology list entries and SYSIB 15.x.x Pierre Morel
2021-07-14 16:53 ` [PATCH v1 5/9] s390x: topology: implementating Store Topology System Information Pierre Morel
2021-07-14 16:53 ` [PATCH v1 6/9] s390x: kvm: topology: interception of PTF instruction Pierre Morel
2021-07-16  9:22   ` Cornelia Huck
2021-07-16 11:23     ` Pierre Morel
2021-07-16 11:56       ` Cornelia Huck
2021-07-14 16:53 ` [PATCH v1 7/9] s390x: SCLP: reporting the maximum nested topology entries Pierre Morel
2021-07-16  9:24   ` Cornelia Huck
2021-07-16 11:12     ` Pierre Morel
2021-07-14 16:53 ` [PATCH v1 8/9] s390x: numa: define drawers and books for NUMA Pierre Morel
2021-07-14 16:53 ` [PATCH v1 9/9] s390x: numa: implement NUMA for S390x 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=fb7beb44-4a25-8ebf-2bd9-be7e4ca15a1a@linux.ibm.com \
    --to=pmorel@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=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --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).