qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* question on s390x topology: KVM only, or also TCG?
@ 2024-03-14 15:49 Claudio Fontana
  2024-03-14 15:54 ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: Claudio Fontana @ 2024-03-14 15:49 UTC (permalink / raw)
  To: Pierre Morel; +Cc: qemu-devel, Ilya Leoshkevich

Hello Pierre, Ilya,

I have a question on the s390x "topology" feature and examples.

Mainly, is this feature supposed to be KVM accelerator-only, or also available when using the TCG accelerator?

(docs/devel/s390-cpu-topology.rst vs https://www.qemu.org/docs/master/system/s390x/cpu-topology.html)

I see stsi-topology.c in target/s390x/kvm/ , so that part is clearly KVM-specific,

but in hw/s390x/cpu-topology.c I read:

"
 * - The first part in this file is taking care of all common functions                                                                     
 *   used by KVM and TCG to create and modify the topology.                                                                                 
 *                                                                                                                                          
 * - The second part, building the topology information data for the                                                                        
 *   guest with CPU and KVM specificity will be implemented inside                                                                          
 *   the target/s390/kvm sub tree.
"

In the docs/devel/s390-cpu-topology.rst

I see the example command:

 qemu-system-s390x \
    -enable-kvm \
    -cpu z14,ctop=on \
    -smp 1,drawers=3,books=3,sockets=2,cores=2,maxcpus=36 \
    -device z14-s390x-cpu,core-id=19,entitlement=high \
    -device z14-s390x-cpu,core-id=11,entitlement=low \
    -device z14-s390x-cpu,core-id=12,entitlement=high \
   ...


which uses KVM only.

In https://www.qemu.org/docs/master/system/s390x/cpu-topology.html

I read:

"Prerequisites:
To use the CPU topology, you need to run with KVM on a s390x host that uses the Linux kernel v6.0 or newer (which provide the so-called KVM_CAP_S390_CPU_TOPOLOGY capability that allows QEMU to signal the CPU topology facility via the so-called STFLE bit 11 to the VM).
"

So I would assume this is KVM-only, but then in the "Examples" section below I see the example:

"
$ qemu-system-s390x -m 2G \
  -cpu gen16b,ctop=on \
  -smp cpus=5,sockets=8,cores=4,maxcpus=32 \
  -device host-s390x-cpu,core-id=14 \
"

and

"
qemu-system-s390x -m 2G \
  -cpu gen16b,ctop=on \
  -smp cpus=1,sockets=8,cores=4,maxcpus=32 \
  \
  -device gen16b-s390x-cpu,drawer-id=1,book-id=1,socket-id=2,core-id=1 \
  -device gen16b-s390x-cpu,drawer-id=1,book-id=1,socket-id=2,core-id=2 \
  -device gen16b-s390x-cpu,drawer-id=1,book-id=1,socket-id=2,core-id=3 \
  \
  -device gen16b-s390x-cpu,drawer-id=0,book-id=0,socket-id=0,core-id=9 \
  -device gen16b-s390x-cpu,drawer-id=0,book-id=0,socket-id=0,core-id=14 \
  \
  -device gen16b-s390x-cpu,core-id=4,dedicated=on,entitlement=high
"

We received questions about this, so I hope you can shed some light, maybe it would be good to just update the web page to include -accel kvm or -enable-kvm everywhere for clarity?

Thanks for your help on this,

Claudio

-- 
Claudio Fontana
Engineering Manager Virtualization, SUSE Labs Core

SUSE Software Solutions Italy Srl


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question on s390x topology: KVM only, or also TCG?
  2024-03-14 15:49 question on s390x topology: KVM only, or also TCG? Claudio Fontana
@ 2024-03-14 15:54 ` Thomas Huth
  2024-03-14 16:44   ` Nina Schoetterl-Glausch
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2024-03-14 15:54 UTC (permalink / raw)
  To: Claudio Fontana, Nina Schoetterl-Glausch
  Cc: qemu-devel, Ilya Leoshkevich, qemu-s390x

On 14/03/2024 16.49, Claudio Fontana wrote:
> Hello Pierre, Ilya,
> 
> I have a question on the s390x "topology" feature and examples.
> 
> Mainly, is this feature supposed to be KVM accelerator-only, or also available when using the TCG accelerator?

  Hi Claudio!

Pierre left IBM, please CC: Nina with regards to s390x topology instead.

But with regards to your question, I think I can answer that, too: The 
topology feature is currently working with KVM only, yes. It hasn't been 
implemented for TCG yet.

> (docs/devel/s390-cpu-topology.rst vs https://www.qemu.org/docs/master/system/s390x/cpu-topology.html)
> 
> I see stsi-topology.c in target/s390x/kvm/ , so that part is clearly KVM-specific,
> 
> but in hw/s390x/cpu-topology.c I read:
> 
> "
>   * - The first part in this file is taking care of all common functions
>   *   used by KVM and TCG to create and modify the topology.
>   *
>   * - The second part, building the topology information data for the
>   *   guest with CPU and KVM specificity will be implemented inside
>   *   the target/s390/kvm sub tree.
> "
> 
> In the docs/devel/s390-cpu-topology.rst
> 
> I see the example command:
> 
>   qemu-system-s390x \
>      -enable-kvm \
>      -cpu z14,ctop=on \
>      -smp 1,drawers=3,books=3,sockets=2,cores=2,maxcpus=36 \
>      -device z14-s390x-cpu,core-id=19,entitlement=high \
>      -device z14-s390x-cpu,core-id=11,entitlement=low \
>      -device z14-s390x-cpu,core-id=12,entitlement=high \
>     ...
> 
> 
> which uses KVM only.
> 
> In https://www.qemu.org/docs/master/system/s390x/cpu-topology.html
> 
> I read:
> 
> "Prerequisites:
> To use the CPU topology, you need to run with KVM on a s390x host that uses the Linux kernel v6.0 or newer (which provide the so-called KVM_CAP_S390_CPU_TOPOLOGY capability that allows QEMU to signal the CPU topology facility via the so-called STFLE bit 11 to the VM).
> "
> 
> So I would assume this is KVM-only, but then in the "Examples" section below I see the example:
> 
> "
> $ qemu-system-s390x -m 2G \
>    -cpu gen16b,ctop=on \
>    -smp cpus=5,sockets=8,cores=4,maxcpus=32 \
>    -device host-s390x-cpu,core-id=14 \
> "
> 
> and
> 
> "
> qemu-system-s390x -m 2G \
>    -cpu gen16b,ctop=on \
>    -smp cpus=1,sockets=8,cores=4,maxcpus=32 \
>    \
>    -device gen16b-s390x-cpu,drawer-id=1,book-id=1,socket-id=2,core-id=1 \
>    -device gen16b-s390x-cpu,drawer-id=1,book-id=1,socket-id=2,core-id=2 \
>    -device gen16b-s390x-cpu,drawer-id=1,book-id=1,socket-id=2,core-id=3 \
>    \
>    -device gen16b-s390x-cpu,drawer-id=0,book-id=0,socket-id=0,core-id=9 \
>    -device gen16b-s390x-cpu,drawer-id=0,book-id=0,socket-id=0,core-id=14 \
>    \
>    -device gen16b-s390x-cpu,core-id=4,dedicated=on,entitlement=high
> "
> 
> We received questions about this, so I hope you can shed some light, maybe it would be good to just update the web page to include -accel kvm or -enable-kvm everywhere for clarity?

Yes, it would be better to include "-accel kvm" in those examples. Would you 
like to send a patch?

  Thanks,
   Thomas




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question on s390x topology: KVM only, or also TCG?
  2024-03-14 15:54 ` Thomas Huth
@ 2024-03-14 16:44   ` Nina Schoetterl-Glausch
  2024-03-14 17:24     ` Claudio Fontana
  0 siblings, 1 reply; 4+ messages in thread
From: Nina Schoetterl-Glausch @ 2024-03-14 16:44 UTC (permalink / raw)
  To: Thomas Huth, Claudio Fontana; +Cc: qemu-devel, Ilya Leoshkevich, qemu-s390x

On Thu, 2024-03-14 at 16:54 +0100, Thomas Huth wrote:
> On 14/03/2024 16.49, Claudio Fontana wrote:
> > Hello Pierre, Ilya,
> > 
> > I have a question on the s390x "topology" feature and examples.
> > 
> > Mainly, is this feature supposed to be KVM accelerator-only, or also available when using the TCG accelerator?
> 
>   Hi Claudio!
> 
> Pierre left IBM, please CC: Nina with regards to s390x topology instead.
> 
> But with regards to your question, I think I can answer that, too: The 
> topology feature is currently working with KVM only, yes. It hasn't been 
> implemented for TCG yet.
> 
> > (docs/devel/s390-cpu-topology.rst vs https://www.qemu.org/docs/master/system/s390x/cpu-topology.html)
> > 
> > I see stsi-topology.c in target/s390x/kvm/ , so that part is clearly KVM-specific,
> > 
> > but in hw/s390x/cpu-topology.c I read:
> > 
> > "
> >   * - The first part in this file is taking care of all common functions
> >   *   used by KVM and TCG to create and modify the topology.

What Thomas said. Read this as the code in file being independent with respect to the accelerator,
it's just that TCG support is missing.
 
[...]
> > 
> > So I would assume this is KVM-only, but then in the "Examples" section below I see the example:
> > 
> > "
> > $ qemu-system-s390x -m 2G \
> >    -cpu gen16b,ctop=on \

TCG doesn't support this cpu ^ and so will refuse to run.

> >    -smp cpus=5,sockets=8,cores=4,maxcpus=32 \

When running with TCG, drawers & books are supported by -smp also, but well, you cannot do anything
with that.

[...]
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question on s390x topology: KVM only, or also TCG?
  2024-03-14 16:44   ` Nina Schoetterl-Glausch
@ 2024-03-14 17:24     ` Claudio Fontana
  0 siblings, 0 replies; 4+ messages in thread
From: Claudio Fontana @ 2024-03-14 17:24 UTC (permalink / raw)
  To: Nina Schoetterl-Glausch, Thomas Huth
  Cc: qemu-devel, Ilya Leoshkevich, qemu-s390x

On 3/14/24 17:44, Nina Schoetterl-Glausch wrote:
> On Thu, 2024-03-14 at 16:54 +0100, Thomas Huth wrote:
>> On 14/03/2024 16.49, Claudio Fontana wrote:
>>> Hello Pierre, Ilya,
>>>
>>> I have a question on the s390x "topology" feature and examples.
>>>
>>> Mainly, is this feature supposed to be KVM accelerator-only, or also available when using the TCG accelerator?
>>
>>   Hi Claudio!
>>
>> Pierre left IBM, please CC: Nina with regards to s390x topology instead.
>>
>> But with regards to your question, I think I can answer that, too: The 
>> topology feature is currently working with KVM only, yes. It hasn't been 
>> implemented for TCG yet.
>>
>>> (docs/devel/s390-cpu-topology.rst vs https://www.qemu.org/docs/master/system/s390x/cpu-topology.html)
>>>
>>> I see stsi-topology.c in target/s390x/kvm/ , so that part is clearly KVM-specific,
>>>
>>> but in hw/s390x/cpu-topology.c I read:
>>>
>>> "
>>>   * - The first part in this file is taking care of all common functions
>>>   *   used by KVM and TCG to create and modify the topology.
> 
> What Thomas said. Read this as the code in file being independent with respect to the accelerator,
> it's just that TCG support is missing.
>  
> [...]
>>>
>>> So I would assume this is KVM-only, but then in the "Examples" section below I see the example:
>>>
>>> "
>>> $ qemu-system-s390x -m 2G \
>>>    -cpu gen16b,ctop=on \
> 
> TCG doesn't support this cpu ^ and so will refuse to run.
> 
>>>    -smp cpus=5,sockets=8,cores=4,maxcpus=32 \
> 
> When running with TCG, drawers & books are supported by -smp also, but well, you cannot do anything
> with that.
> 
> [...]
>>
> 

Thank you for your responses Thomas and Nina,
I have just sent a patch that tries to make it even more explicit.

"[PATCH] docs/s390: clarify even more that cpu-topology is KVM-only"

Thanks,

Claudio


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-14 17:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-14 15:49 question on s390x topology: KVM only, or also TCG? Claudio Fontana
2024-03-14 15:54 ` Thomas Huth
2024-03-14 16:44   ` Nina Schoetterl-Glausch
2024-03-14 17:24     ` Claudio Fontana

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).