[PATCH v11 08/11] s390x/cpu topology: add topology_capable QEMU capability

Pierre Morel posted 11 patches 3 years, 3 months ago
Maintainers: Thomas Huth <thuth@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>
There is a newer version of this series
[PATCH v11 08/11] s390x/cpu topology: add topology_capable QEMU capability
Posted by Pierre Morel 3 years, 3 months ago
S390 CPU topology is only allowed for s390-virtio-ccw-7.2 and
newer S390 machines.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
 include/hw/s390x/s390-virtio-ccw.h | 1 +
 hw/s390x/s390-virtio-ccw.c         | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h
index 6488279690..89fca3f79f 100644
--- a/include/hw/s390x/s390-virtio-ccw.h
+++ b/include/hw/s390x/s390-virtio-ccw.h
@@ -48,6 +48,7 @@ struct S390CcwMachineClass {
     bool css_migration_enabled;
     bool hpage_1m_allowed;
     int max_threads;
+    bool topology_capable;
 };
 
 /* runtime-instrumentation allowed by the machine */
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 4de2622f99..f1a9d6e793 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -763,6 +763,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
     s390mc->css_migration_enabled = true;
     s390mc->hpage_1m_allowed = true;
     s390mc->max_threads = 1;
+    s390mc->topology_capable = true;
     mc->init = ccw_init;
     mc->reset = s390_machine_reset;
     mc->block_default_type = IF_VIRTIO;
@@ -896,6 +897,7 @@ static void ccw_machine_7_1_class_options(MachineClass *mc)
     ccw_machine_7_2_class_options(mc);
     compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len);
     s390mc->max_threads = S390_MAX_CPUS;
+    s390mc->topology_capable = false;
 }
 DEFINE_CCW_MACHINE(7_1, "7.1", false);
 
-- 
2.31.1
Re: [PATCH v11 08/11] s390x/cpu topology: add topology_capable QEMU capability
Posted by Cédric Le Goater 3 years, 2 months ago
On 11/3/22 18:01, Pierre Morel wrote:
> S390 CPU topology is only allowed for s390-virtio-ccw-7.2 and
> newer S390 machines.
> 
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>   include/hw/s390x/s390-virtio-ccw.h | 1 +
>   hw/s390x/s390-virtio-ccw.c         | 2 ++
>   2 files changed, 3 insertions(+)
> 
> diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h
> index 6488279690..89fca3f79f 100644
> --- a/include/hw/s390x/s390-virtio-ccw.h
> +++ b/include/hw/s390x/s390-virtio-ccw.h
> @@ -48,6 +48,7 @@ struct S390CcwMachineClass {
>       bool css_migration_enabled;
>       bool hpage_1m_allowed;
>       int max_threads;
> +    bool topology_capable;
>   };
>   
>   /* runtime-instrumentation allowed by the machine */
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 4de2622f99..f1a9d6e793 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -763,6 +763,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
>       s390mc->css_migration_enabled = true;
>       s390mc->hpage_1m_allowed = true;
>       s390mc->max_threads = 1;
> +    s390mc->topology_capable = true;
>       mc->init = ccw_init;
>       mc->reset = s390_machine_reset;
>       mc->block_default_type = IF_VIRTIO;
> @@ -896,6 +897,7 @@ static void ccw_machine_7_1_class_options(MachineClass *mc)
>       ccw_machine_7_2_class_options(mc);
>       compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len);
>       s390mc->max_threads = S390_MAX_CPUS;
> +    s390mc->topology_capable = false;
>   }
>   DEFINE_CCW_MACHINE(7_1, "7.1", false);
>   


Re: [PATCH v11 08/11] s390x/cpu topology: add topology_capable QEMU capability
Posted by Pierre Morel 3 years, 2 months ago

On 11/15/22 14:27, Cédric Le Goater wrote:
> On 11/3/22 18:01, Pierre Morel wrote:
>> S390 CPU topology is only allowed for s390-virtio-ccw-7.2 and
>> newer S390 machines.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> 
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> 
> Thanks,
> 
> C.

Thanks,

Pierre


-- 
Pierre Morel
IBM Lab Boeblingen