qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: "Cédric Le Goater" <clg@kaod.org>, 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, scgl@linux.ibm.com, frankja@linux.ibm.com,
	berrange@redhat.com
Subject: Re: [PATCH v12 2/7] s390x/cpu topology: reporting the CPU topology to the guest
Date: Wed, 7 Dec 2022 10:58:31 +0100	[thread overview]
Message-ID: <43ca70fb-2b67-2075-3bc7-e7dbda64531e@linux.ibm.com> (raw)
In-Reply-To: <697092bd-9920-a73e-7652-07b8ecc8daff@kaod.org>



On 12/7/22 10:12, Cédric Le Goater wrote:
> On 11/29/22 18:42, Pierre Morel wrote:
>> The guest uses the STSI instruction to get information on the
>> CPU topology.
>>
>> Let us implement the STSI instruction for the basis CPU topology
>> level, level 2.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---

...snip...

>> +
>> +#define S390_TOPOLOGY_MAX_MNEST 2
>> +
>> +void insert_stsi_15_1_x(S390CPU *cpu, int sel2, __u64 addr, uint8_t ar)
>> +{
>> +    union {
>> +        char place_holder[S390_TOPOLOGY_SYSIB_SIZE];
>> +        SysIB_151x sysib;
>> +    } buffer QEMU_ALIGNED(8);
>> +    int len;
>> +
>> +    if (s390_is_pv() || !s390_has_topology() ||
>> +        sel2 < 2 || sel2 > S390_TOPOLOGY_MAX_MNEST) {
>> +        setcc(cpu, 3);
>> +        return;
>> +    }
>>
>> +    s390_prepare_topology(S390_CCW_MACHINE(cpu->machine_data));
>> +
>> +    len = setup_stsi(cpu, &buffer.sysib, sel2);
> 
> 
> The S390_CPU_TOPOLOGY object is created by the machine at init time
> and the two above routines are the only users of this object.

This is right at this moment but the object will be used in the next 
patches for implementing reset, patch 3, and migration, patch 4.


> 
> The first loops on all possible CPUs to populate the bitmask array
> 'socket' under S390_CPU_TOPOLOGY and the second uses the result to
> populate the buffer returned to the guest OS.
> 
> I don't understand why the S390_CPU_TOPOLOGY object is needed at all.
> AFAICT, this is just adding extra complexity.

I used an object because I thought it could be cleaner for the 
implementation of reset and migration.

> Is the pachset preparing
> ground for some more features ? 

Yes it is, I removed the books and drawers topology containers from this 
patch series in the version 10 of the patch series to postpone their 
implementation.

The next series on topology implementation will also add, beside the 
implementation of drawers and books, the possibility to modify the 
topology during the life of a guest.

These, book, drawer and the topology modification will need to be migrated.

Is there a good alternative to facilitate the implementation of the 
migration ?

Of course we can put all together inside the CcwMachineState but 
wouldn't the use of a dedicated object make it all cleaner?

Regards,
Pierre

If so, it should be explained in the
> commit log.
> 
> As for now, I see no good justification for S390_CPU_TOPOLOGY and we
> could add support with a simple routine called from insert_stsi_15_1_x().
> 
> Thanks,
> 
> C.

-- 
Pierre Morel
IBM Lab Boeblingen


  reply	other threads:[~2022-12-07  9:59 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 17:41 [PATCH v12 0/7] s390x: CPU Topology Pierre Morel
2022-11-29 17:42 ` [PATCH v12 1/7] s390x/cpu topology: Creating CPU topology device Pierre Morel
2022-12-01  9:08   ` Thomas Huth
2022-12-01  9:37     ` Pierre Morel
2022-12-06  9:31   ` Janis Schoetterl-Glausch
2022-12-06 10:32     ` Pierre Morel
2022-12-06 13:35       ` Janis Schoetterl-Glausch
2022-12-06 14:35         ` Pierre Morel
2022-12-06 21:06           ` Janis Schoetterl-Glausch
2022-12-07 10:00             ` Pierre Morel
2022-12-07 11:38               ` Janis Schoetterl-Glausch
2022-12-07 11:52                 ` Pierre Morel
2022-11-29 17:42 ` [PATCH v12 2/7] s390x/cpu topology: reporting the CPU topology to the guest Pierre Morel
2022-12-06  9:48   ` Janis Schoetterl-Glausch
2022-12-06 10:38     ` Pierre Morel
2022-12-06 14:44   ` Pierre Morel
2022-12-07  9:12   ` Cédric Le Goater
2022-12-07  9:58     ` Pierre Morel [this message]
2022-11-29 17:42 ` [PATCH v12 3/7] s390x/cpu_topology: resetting the Topology-Change-Report Pierre Morel
2022-12-06  9:50   ` Janis Schoetterl-Glausch
2022-12-06 11:51     ` Pierre Morel
2022-11-29 17:42 ` [PATCH v12 4/7] s390x/cpu_topology: CPU topology migration Pierre Morel
2022-11-29 17:42 ` [PATCH v12 5/7] s390x/cpu_topology: interception of PTF instruction Pierre Morel
2022-11-29 17:42 ` [PATCH v12 6/7] s390x/cpu_topology: activating CPU topology Pierre Morel
2022-12-01 10:15   ` Thomas Huth
2022-12-01 11:52     ` Pierre Morel
2022-12-02  9:05       ` Thomas Huth
2022-12-02 14:08         ` Pierre Morel
2022-12-02 14:26           ` Thomas Huth
2022-12-05 13:29             ` Pierre Morel
2022-11-29 17:42 ` [PATCH v12 7/7] docs/s390x: document s390x cpu topology Pierre Morel
2022-12-01  8:45 ` [PATCH v12 0/7] s390x: CPU Topology Cédric Le Goater
2022-12-01 13:23   ` 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=43ca70fb-2b67-2075-3bc7-e7dbda64531e@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=clg@kaod.org \
    --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=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=scgl@linux.ibm.com \
    --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).