public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>, linux-s390@vger.kernel.org
Cc: thuth@redhat.com, kvm@vger.kernel.org, cohuck@redhat.com,
	imbrenda@linux.ibm.com, david@redhat.com
Subject: Re: [kvm-unit-tests PATCH v3 4/4] s390x: topology: Checking Configuration Topology Information
Date: Mon, 17 Jan 2022 16:14:50 +0100	[thread overview]
Message-ID: <9aa09fba-27ef-ddd5-462a-165b38f6d58a@linux.ibm.com> (raw)
In-Reply-To: <45dea0fb-5605-5f98-74c7-d68f7841f1b6@linux.ibm.com>



On 1/11/22 14:30, Janosch Frank wrote:
> On 1/10/22 14:37, Pierre Morel wrote:
>> STSI with function code 15 is used to store the CPU configuration
>> topology.
>>
>> We check :
>> - if the topology stored is coherent between the QEMU -smp
>>    parameters and kernel parameters.
>> - the number of CPUs
>> - the maximum number of CPUs
>> - the number of containers of each levels for every STSI(15.1.x)
>>    instruction allowed by the machine.
> 
> The full review of this will take some time.
> 
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
>>   lib/s390x/stsi.h    |  44 +++++++++
>>   s390x/topology.c    | 231 ++++++++++++++++++++++++++++++++++++++++++++
>>   s390x/unittests.cfg |   1 +
>>   3 files changed, 276 insertions(+)
>>
>> diff --git a/lib/s390x/stsi.h b/lib/s390x/stsi.h
>> index 02cc94a6..e3fc7ac0 100644
>> --- a/lib/s390x/stsi.h
>> +++ b/lib/s390x/stsi.h
>> @@ -29,4 +29,48 @@ struct sysinfo_3_2_2 {
>>       uint8_t ext_names[8][256];
>>   };
>> +struct topology_core {
>> +    uint8_t nl;
>> +    uint8_t reserved1[3];
>> +    uint8_t reserved4:5;
>> +    uint8_t d:1;
>> +    uint8_t pp:2;
>> +    uint8_t type;
>> +    uint16_t origin;
>> +    uint64_t mask;
>> +};
>> +
>> +struct topology_container {
>> +    uint8_t nl;
>> +    uint8_t reserved[6];
>> +    uint8_t id;
>> +};
>> +
>> +union topology_entry {
>> +    uint8_t nl;
>> +    struct topology_core cpu;
>> +    struct topology_container container;
>> +};
>> +
>> +#define CPU_TOPOLOGY_MAX_LEVEL 6
>> +struct sysinfo_15_1_x {
>> +    uint8_t reserved0[2];
>> +    uint16_t length;
>> +    uint8_t mag[CPU_TOPOLOGY_MAX_LEVEL];
>> +    uint8_t reserved10;
> 
> reserved0a?

OK

> 
>> +    uint8_t mnest;
>> +    uint8_t reserved12[4];
> 
> reserved0c?

OK

> 
>> +    union topology_entry tle[0];

...snip...

>> +static void stsi_check_tle_coherency(struct sysinfo_15_1_x *info, int 
>> sel2)
>> +{
>> +    struct topology_container *tc, *end;
>> +    struct topology_core *cpus;
>> +    int n = 0;
>> +    int i;
>> +
>> +    report_prefix_push("TLE coherency");
>> +
>> +    tc = (void *)&info->tle[0];
> 
> tc = &info->tle[0].container ?

Yes, clearly better than a cast.

> 
>> +    end = (struct topology_container *)((unsigned long)info + 
...snip...
>> +    /* For each level found in STSI */
>> +    for (i = 1; i < CPU_TOPOLOGY_MAX_LEVEL; i++) {
>> +        /*
>> +         * For non QEMU/KVM hypervizor the concatanation of the levels
> 
> hypervisor
> 
> concatenation

Yes, thanks.

> 
>> +         * above level 1 are architecture dependent.

...snip...

Thanks,
Pierre

-- 
Pierre Morel
IBM Lab Boeblingen

      reply	other threads:[~2022-01-17 15:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 13:37 [kvm-unit-tests PATCH v3 0/4] S390x: CPU Topology Information Pierre Morel
2022-01-10 13:37 ` [kvm-unit-tests PATCH v3 1/4] s390x: lib: Add SCLP toplogy nested level Pierre Morel
2022-01-10 13:37 ` [kvm-unit-tests PATCH v3 2/4] s390x: stsi: Define vm_is_kvm to be used in different tests Pierre Morel
2022-01-11 12:27   ` Janosch Frank
2022-01-17 14:57     ` Pierre Morel
2022-01-18  8:35       ` Janosch Frank
2022-01-18 17:07         ` Pierre Morel
2022-01-11 13:08   ` Claudio Imbrenda
2022-01-17 15:05     ` Pierre Morel
2022-01-10 13:37 ` [kvm-unit-tests PATCH v3 3/4] s390x: topology: Check the Perform Topology Function Pierre Morel
2022-01-11 11:25   ` Claudio Imbrenda
2022-01-17 15:07     ` Pierre Morel
2022-01-10 13:37 ` [kvm-unit-tests PATCH v3 4/4] s390x: topology: Checking Configuration Topology Information Pierre Morel
2022-01-11 13:30   ` Janosch Frank
2022-01-17 15:14     ` 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=9aa09fba-27ef-ddd5-462a-165b38f6d58a@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.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