[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v24 10/21] machine: adding s390 topology to query-cpu-fast
From: |
Nina Schoetterl-Glausch |
Subject: |
[PATCH v24 10/21] machine: adding s390 topology to query-cpu-fast |
Date: |
Tue, 26 Sep 2023 14:15:23 +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>
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
---
qapi/machine.json | 11 ++++++++++-
target/s390x/cpu.c | 9 +++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index 8499d40269..eb2de7acc7 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -57,9 +57,18 @@
#
# @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 74405beb51..5967e34a85 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.39.2
- [PATCH v24 17/21] tests/avocado: s390x cpu topology entitlement tests, (continued)
- [PATCH v24 17/21] tests/avocado: s390x cpu topology entitlement tests, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 03/21] s390x/cpu topology: add topology entries on CPU hotplug, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 20/21] tests/avocado: s390x cpu topology dedicated errors, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 18/21] tests/avocado: s390x cpu topology test dedicated CPU, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 19/21] tests/avocado: s390x cpu topology test socket full, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 13/21] qapi/s390x/cpu topology: add query-s390x-cpu-polarization command, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 06/21] s390x/cpu topology: resetting the Topology-Change-Report, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 15/21] tests/avocado: s390x cpu topology core, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 09/21] qapi/s390x/cpu topology: set-cpu-topology qmp command, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 10/21] machine: adding s390 topology to query-cpu-fast,
Nina Schoetterl-Glausch <=
- [PATCH v24 01/21] qapi: machine.json: change docs regarding CpuInstanceProperties, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 16/21] tests/avocado: s390x cpu topology polarization, Nina Schoetterl-Glausch, 2023/09/26
- [PATCH v24 21/21] tests/avocado: s390x cpu topology bad move, Nina Schoetterl-Glausch, 2023/09/26