public inbox for kvm@vger.kernel.org
 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, philmd@redhat.com, eblake@redhat.com,
	armbru@redhat.com, seiden@linux.ibm.com, nrb@linux.ibm.com,
	frankja@linux.ibm.com
Subject: Re: [PATCH v7 04/13] s390x: topology: implementating Store Topology System Information
Date: Wed, 25 May 2022 10:16:49 +0200	[thread overview]
Message-ID: <8f69ba01-e1c2-5bb9-785d-658877559de8@linux.ibm.com> (raw)
In-Reply-To: <6e426ed7-d3a6-2ae8-badc-80fc7a31c3ea@redhat.com>



On 5/24/22 12:59, Thomas Huth wrote:
> On 20/04/2022 13.57, Pierre Morel wrote:
>> The handling of STSI is enhanced with the interception of the
>> function code 15 for storing CPU topology.
>>
>> Using the objects built during the pluging of CPU, we build the
> 
> s/pluging/plugging/
> 
>> SYSIB 15_1_x structures.
>>
>> With this patch the maximum MNEST level is 2, this is also
>> the only level allowed and only SYSIB 15_1_2 will be built.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
> ...
>> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
>> index f6969b76c5..a617c943ff 100644
>> --- a/target/s390x/cpu.h
>> +++ b/target/s390x/cpu.h
>> @@ -889,4 +889,5 @@ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr);
>>   #include "exec/cpu-all.h"
>> +void insert_stsi_15_1_x(S390CPU *cpu, int sel2, __u64 addr, uint8_t ar);
>>   #endif
> 
> Please keep an empty line before the #endif

OK

> 
>> diff --git a/target/s390x/cpu_topology.c b/target/s390x/cpu_topology.c
>> new file mode 100644
>> index 0000000000..7f6db18829
>> --- /dev/null
>> +++ b/target/s390x/cpu_topology.c
>> @@ -0,0 +1,112 @@
>> +/*
>> + * QEMU S390x CPU Topology
>> + *
>> + * Copyright IBM Corp. 2021
> 
> 2022 ?
:) yes

> 
>> + * Author(s): Pierre Morel <pmorel@linux.ibm.com>
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2 or 
>> (at
>> + * your option) any later version. See the COPYING file in the top-level
>> + * directory.
>> + */
> ...
>> +void insert_stsi_15_1_x(S390CPU *cpu, int sel2, __u64 addr, uint8_t ar)
>> +{
>> +    const MachineState *machine = MACHINE(qdev_get_machine());
>> +    void *p;
>> +    int ret, cc;
>> +
>> +    /*
>> +     * Until the SCLP STSI Facility reporting the MNEST value is used,
>> +     * a sel2 value of 2 is the only value allowed in STSI 15.1.x.
>> +     */
>> +    if (sel2 != 2) {
>> +        setcc(cpu, 3);
>> +        return;
>> +    }
>> +
>> +    p = g_malloc0(TARGET_PAGE_SIZE);
>> +
>> +    setup_stsi(machine, p, 2);
>> +
>> +    if (s390_is_pv()) {
>> +        ret = s390_cpu_pv_mem_write(cpu, 0, p, TARGET_PAGE_SIZE);
>> +    } else {
>> +        ret = s390_cpu_virt_mem_write(cpu, addr, ar, p, 
>> TARGET_PAGE_SIZE);
>> +    }
>> +    cc = ret ? 3 : 0;
>> +    setcc(cpu, cc);
> 
> Just a matter of taste (i.e. keep it if you like) - but you could 
> scratch the cc variable in this function by just doing:
> 
>      setcc(cpu, ret ? 3 : 0);
> 

OK I can do this.

Thanks
Pierre

>> +    g_free(p);
>> +}
>> +
> 
>   Thomas
> 

-- 
Pierre Morel
IBM Lab Boeblingen

  reply	other threads:[~2022-05-25  8:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 11:57 [PATCH v7 00/13] s390x: CPU Topology Pierre Morel
2022-04-20 11:57 ` [PATCH v7 01/13] Update linux headers Pierre Morel
2022-04-20 11:57 ` [PATCH v7 02/13] vfio: tolerate migration protocol v1 uapi renames Pierre Morel
2022-04-20 11:57 ` [PATCH v7 03/13] s390x: topology: CPU topology objects and structures Pierre Morel
2022-05-19 10:45   ` Thomas Huth
2022-05-19 15:22     ` Pierre Morel
2022-04-20 11:57 ` [PATCH v7 04/13] s390x: topology: implementating Store Topology System Information Pierre Morel
2022-05-24 10:59   ` Thomas Huth
2022-05-25  8:16     ` Pierre Morel [this message]
2022-05-24 11:08   ` Thomas Huth
2022-05-25  8:18     ` Pierre Morel
2022-04-20 11:57 ` [PATCH v7 05/13] s390x: topology: Adding books to CPU topology Pierre Morel
2022-04-20 11:57 ` [PATCH v7 06/13] s390x: topology: Adding books to STSI Pierre Morel
2022-05-24 11:07   ` Thomas Huth
2022-05-25  8:17     ` Pierre Morel
2022-04-20 11:57 ` [PATCH v7 07/13] s390x: topology: Adding drawers to CPU topology Pierre Morel
2022-04-20 11:57 ` [PATCH v7 08/13] s390x: topology: Adding drawers to STSI Pierre Morel
2022-05-24 11:10   ` Thomas Huth
2022-05-25  8:19     ` Pierre Morel
2022-04-20 11:57 ` [PATCH v7 09/13] s390x: topology: implementing numa for the s390x topology Pierre Morel
2022-04-20 11:57 ` [PATCH v7 10/13] s390x: kvm: topology: interception of PTF instruction Pierre Morel
2022-05-24 11:27   ` Thomas Huth
2022-05-25  8:22     ` Pierre Morel
2022-04-20 11:57 ` [PATCH v7 11/13] s390x: topology: resetting the Topology-Change-Report Pierre Morel
2022-04-20 11:57 ` [PATCH v7 12/13] s390x: CPU topology: CPU topology migration Pierre Morel
2022-05-24 11:32   ` Thomas Huth
2022-05-25  8:23     ` Pierre Morel
2022-04-20 11:57 ` [PATCH v7 13/13] s390x: topology: activating 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=8f69ba01-e1c2-5bb9-785d-658877559de8@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=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=philmd@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