diff mbox series

[v1,8/9] s390x: numa: define drawers and books for NUMA

Message ID 1626281596-31061-9-git-send-email-pmorel@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: CPU Topology | expand

Commit Message

Pierre Morel July 14, 2021, 4:53 p.m. UTC
S390 uses 5 levels of CPU topology, we implement the four lower levels:
drawers, books, sockets and cores.

Until now drawers and books were not defined, this patch add the
definition for drawers and books to the machine.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
 hw/core/machine.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff mbox series

Patch

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 6f59fb0b7f..a193ffcd3b 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -692,6 +692,16 @@  void machine_set_cpu_numa_node(MachineState *machine,
             return;
         }
 
+        if (props->has_drawer_id && !slot->props.has_drawer_id) {
+            error_setg(errp, "drawer-id is not supported");
+            return;
+        }
+
+        if (props->has_book_id && !slot->props.has_book_id) {
+            error_setg(errp, "book-id is not supported");
+            return;
+        }
+
         /* skip slots with explicit mismatch */
         if (props->has_thread_id && props->thread_id != slot->props.thread_id) {
                 continue;
@@ -705,6 +715,14 @@  void machine_set_cpu_numa_node(MachineState *machine,
                 continue;
         }
 
+        if (props->has_drawer_id && props->drawer_id != slot->props.drawer_id) {
+                continue;
+        }
+
+        if (props->has_book_id && props->book_id != slot->props.book_id) {
+                continue;
+        }
+
         if (props->has_socket_id && props->socket_id != slot->props.socket_id) {
                 continue;
         }