[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/25] machine: adding s390 topology to query-cpu-fast
From: |
Thomas Huth |
Subject: |
[PULL 10/25] machine: adding s390 topology to query-cpu-fast |
Date: |
Wed, 18 Oct 2023 15:07:01 +0200 |
From: Pierre Morel <pmorel@linux.ibm.com>
S390x provides two more topology attributes, entitlement and dedication.
Let's add these CPU attributes to the QAPI command query-cpu-fast.
Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Message-ID: <20231016183925.2384704-11-nsg@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
qapi/machine.json | 9 ++++++++-
target/s390x/cpu.c | 9 +++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index 17b69a6aea..b4bd26f716 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -57,9 +57,16 @@
#
# @cpu-state: the virtual CPU's state
#
+# @dedicated: the virtual CPU's dedication (since 8.2)
+#
+# @entitlement: the virtual CPU's entitlement (since 8.2)
+#
# Since: 2.12
##
-{ 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
+{ 'struct': 'CpuInfoS390',
+ 'data': { 'cpu-state': 'CpuS390State',
+ '*dedicated': 'bool',
+ '*entitlement': 'CpuS390Entitlement' } }
##
# @CpuInfoFast:
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index ba646461a1..6acfa1c91b 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -38,6 +38,7 @@
#ifndef CONFIG_USER_ONLY
#include "sysemu/reset.h"
#endif
+#include "hw/s390x/cpu-topology.h"
#define CR0_RESET 0xE0UL
#define CR14_RESET 0xC2000000UL;
@@ -146,6 +147,14 @@ static void s390_query_cpu_fast(CPUState *cpu, CpuInfoFast
*value)
S390CPU *s390_cpu = S390_CPU(cpu);
value->u.s390x.cpu_state = s390_cpu->env.cpu_state;
+#if !defined(CONFIG_USER_ONLY)
+ if (s390_has_topology()) {
+ value->u.s390x.has_dedicated = true;
+ value->u.s390x.dedicated = s390_cpu->env.dedicated;
+ value->u.s390x.has_entitlement = true;
+ value->u.s390x.entitlement = s390_cpu->env.entitlement;
+ }
+#endif
}
/* S390CPUClass::reset() */
--
2.41.0
- [PULL 00/25] s390x patches, Thomas Huth, 2023/10/18
- [PULL 01/25] qapi: machine.json: change docs regarding CPU topology, Thomas Huth, 2023/10/18
- [PULL 05/25] s390x/sclp: reporting the maximum nested topology entries, Thomas Huth, 2023/10/18
- [PULL 03/25] s390x/cpu topology: add topology entries on CPU hotplug, Thomas Huth, 2023/10/18
- [PULL 06/25] s390x/cpu topology: resetting the Topology-Change-Report, Thomas Huth, 2023/10/18
- [PULL 02/25] CPU topology: extend with s390 specifics, Thomas Huth, 2023/10/18
- [PULL 07/25] s390x/cpu topology: interception of PTF instruction, Thomas Huth, 2023/10/18
- [PULL 04/25] target/s390x/cpu topology: handle STSI(15) and build the SYSIB, Thomas Huth, 2023/10/18
- [PULL 08/25] target/s390x/cpu topology: activate CPU topology, Thomas Huth, 2023/10/18
- [PULL 10/25] machine: adding s390 topology to query-cpu-fast,
Thomas Huth <=
- [PULL 11/25] machine: adding s390 topology to info hotpluggable-cpus, Thomas Huth, 2023/10/18
- [PULL 09/25] qapi/s390x/cpu topology: set-cpu-topology qmp command, Thomas Huth, 2023/10/18
- [PULL 12/25] qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE QAPI event, Thomas Huth, 2023/10/18
- [PULL 15/25] tests/avocado: s390x cpu topology core, Thomas Huth, 2023/10/18
- [PULL 19/25] tests/avocado: s390x cpu topology test socket full, Thomas Huth, 2023/10/18
- [PULL 17/25] tests/avocado: s390x cpu topology entitlement tests, Thomas Huth, 2023/10/18
- [PULL 22/25] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req(), Thomas Huth, 2023/10/18
- [PULL 18/25] tests/avocado: s390x cpu topology test dedicated CPU, Thomas Huth, 2023/10/18
- [PULL 21/25] tests/avocado: s390x cpu topology bad move, Thomas Huth, 2023/10/18
- [PULL 25/25] tests/qtest/migration-test: Disable the analyze-migration.py test on s390x, Thomas Huth, 2023/10/18