[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 02/12] s390x/cpu_topology: CPU topology objects and struct
From: |
Janosch Frank |
Subject: |
Re: [PATCH v8 02/12] s390x/cpu_topology: CPU topology objects and structures |
Date: |
Mon, 27 Jun 2022 15:31:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 |
On 6/20/22 16:03, Pierre Morel wrote:
We use new objects to have a dynamic administration of the CPU topology.
The highest level object in this implementation is the s390 book and
in this first implementation of CPU topology for S390 we have a single
book.
The book is built as a SYSBUS bridge during the CPU initialization.
Other objects, sockets and core will be built after the parsing
of the QEMU -smp argument.
Every object under this single book will be build dynamically
immediately after a CPU has be realized if it is needed.
The CPU will fill the sockets once after the other, according to the
number of core per socket defined during the smp parsing.
Each CPU inside a socket will be represented by a bit in a 64bit
unsigned long. Set on plug and clear on unplug of a CPU.
For the S390 CPU topology, thread and cores are merged into
topology cores and the number of topology cores is the multiplication
of cores by the numbers of threads.
Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
[...]
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 7d6d01325b..216adfde26 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -565,6 +565,53 @@ typedef union SysIB {
} SysIB;
QEMU_BUILD_BUG_ON(sizeof(SysIB) != 4096);
+/* CPU type Topology List Entry */
+typedef struct SysIBTl_cpu {
+ uint8_t nl;
+ uint8_t reserved0[3];
+ uint8_t reserved1:5;
+ uint8_t dedicated:1;
+ uint8_t polarity:2;
+ uint8_t type;
+ uint16_t origin;
+ uint64_t mask;
+} SysIBTl_cpu;
+QEMU_BUILD_BUG_ON(sizeof(SysIBTl_cpu) != 16);
+
+/* Container type Topology List Entry */
+typedef struct SysIBTl_container {
+ uint8_t nl;
+ uint8_t reserved[6];
+ uint8_t id;
+} QEMU_PACKED SysIBTl_container;
+QEMU_BUILD_BUG_ON(sizeof(SysIBTl_container) != 8);
+
+/* Generic Topology List Entry */
+typedef union SysIBTl_entry {
+ uint8_t nl;
This union member is unused, isn't it?
+ SysIBTl_container container;
+ SysIBTl_cpu cpu;
+} SysIBTl_entry;
+
+#define TOPOLOGY_NR_MAG 6
TOPOLOGY_TOTAL_NR_MAGS ?
+#define TOPOLOGY_NR_MAG6 0
TOPOLOGY_NR_TLES_MAG6 ?
I'm open to other suggestions but we need to differentiate between the
number of mag array entries and the number of TLEs in the MAGs.
+#define TOPOLOGY_NR_MAG5 1
+#define TOPOLOGY_NR_MAG4 2
+#define TOPOLOGY_NR_MAG3 3
+#define TOPOLOGY_NR_MAG2 4
+#define TOPOLOGY_NR_MAG1 5
I'd appreciate a \n here.
+/* Configuration topology */
+typedef struct SysIB_151x {
+ uint8_t res0[2];
You're using "reserved" everywhere but now it's "rev"?
+ uint16_t length;
+ uint8_t mag[TOPOLOGY_NR_MAG];
+ uint8_t res1;
+ uint8_t mnest;
+ uint32_t res2;
+ SysIBTl_entry tle[0];
+} SysIB_151x;
+QEMU_BUILD_BUG_ON(sizeof(SysIB_151x) != 16);
+
/* MMU defines */
#define ASCE_ORIGIN (~0xfffULL) /* segment table origin
*/
#define ASCE_SUBSPACE 0x200 /* subspace group control
*/
- [PATCH v8 00/12] s390x: CPU Topology, Pierre Morel, 2022/06/20
- [PATCH v8 04/12] s390x/cpu_topology: Adding books to CPU topology, Pierre Morel, 2022/06/20
- [PATCH v8 01/12] Update Linux Headers, Pierre Morel, 2022/06/20
- [PATCH v8 05/12] s390x/cpu_topology: Adding books to STSI, Pierre Morel, 2022/06/20
- [PATCH v8 03/12] s390x/cpu_topology: implementating Store Topology System Information, Pierre Morel, 2022/06/20
- [PATCH v8 07/12] s390x/cpu_topology: Adding drawers to STSI, Pierre Morel, 2022/06/20
- [PATCH v8 11/12] s390x/cpu_topology: CPU topology migration, Pierre Morel, 2022/06/20
- [PATCH v8 02/12] s390x/cpu_topology: CPU topology objects and structures, Pierre Morel, 2022/06/20
- Re: [PATCH v8 02/12] s390x/cpu_topology: CPU topology objects and structures,
Janosch Frank <=
- [PATCH v8 06/12] s390x/cpu_topology: Adding drawers to CPU topology, Pierre Morel, 2022/06/20
- [PATCH v8 08/12] s390x/cpu_topology: implementing numa for the s390x topology, Pierre Morel, 2022/06/20
- [PATCH v8 09/12] target/s390x: interception of PTF instruction, Pierre Morel, 2022/06/20
- [PATCH v8 10/12] s390x/cpu_topology: resetting the Topology-Change-Report, Pierre Morel, 2022/06/20
- [PATCH v8 12/12] s390x/cpu_topology: activating CPU topology, Pierre Morel, 2022/06/20