[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/44] spapr_numa.c: handle auto NUMA node with no distance info
From: |
David Gibson |
Subject: |
[PULL 31/44] spapr_numa.c: handle auto NUMA node with no distance info |
Date: |
Thu, 30 Sep 2021 15:44:13 +1000 |
From: Daniel Henrique Barboza <danielhb413@gmail.com>
numa_complete_configuration() in hw/core/numa.c always adds a NUMA node
for the pSeries machine if none was specified, but without node distance
information for the single node created.
NUMA FORM1 affinity code didn't rely on numa_state information to do its
job, but FORM2 does. As is now, this is the result of a pSeries guest
with NUMA FORM2 affinity when no NUMA nodes is specified:
$ numactl -H
available: 1 nodes (0)
node 0 cpus: 0
node 0 size: 16222 MB
node 0 free: 15681 MB
No distance information available.
This can be amended in spapr_numa_FORM2_write_rtas_tables(). We're
enforcing that the local distance (the distance to the node to itself) is
always 10. This allows for the proper creation of the NUMA distance tables,
fixing the output of 'numactl -H' in the guest:
$ numactl -H
available: 1 nodes (0)
node 0 cpus: 0
node 0 size: 16222 MB
node 0 free: 15685 MB
node distances:
node 0
0: 10
CC: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20210920174947.556324-8-danielhb413@gmail.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr_numa.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/ppc/spapr_numa.c b/hw/ppc/spapr_numa.c
index 13db321997..58d5dc7084 100644
--- a/hw/ppc/spapr_numa.c
+++ b/hw/ppc/spapr_numa.c
@@ -539,6 +539,17 @@ static void
spapr_numa_FORM2_write_rtas_tables(SpaprMachineState *spapr,
for (src = 0; src < nb_numa_nodes; src++) {
for (dst = 0; dst < nb_numa_nodes; dst++) {
+ /*
+ * We need to be explicit with the local distance
+ * value to cover the case where the user didn't added any
+ * NUMA nodes, but QEMU adds the default NUMA node without
+ * adding the numa_info to retrieve distance info from.
+ */
+ if (src == dst) {
+ node_distances[i++] = 10;
+ continue;
+ }
+
node_distances[i++] = numa_info[src].distance[dst];
}
}
--
2.31.1
- [PULL 21/44] target/ppc: Convert debug to trace events (exceptions), (continued)
- [PULL 21/44] target/ppc: Convert debug to trace events (exceptions), David Gibson, 2021/09/30
- [PULL 22/44] target/ppc: Replace debug messages by asserts for unknown IRQ pins, David Gibson, 2021/09/30
- [PULL 23/44] target/ppc: add LPCR[HR] to DisasContext and hflags, David Gibson, 2021/09/30
- [PULL 24/44] target/ppc: Check privilege level based on PSR and LPCR[HR] in tlbie[l], David Gibson, 2021/09/30
- [PULL 26/44] spapr_numa.c: scrap 'legacy_numa' concept, David Gibson, 2021/09/30
- [PULL 27/44] spapr_numa.c: parametrize FORM1 macros, David Gibson, 2021/09/30
- [PULL 29/44] spapr: move FORM1 verifications to post CAS, David Gibson, 2021/09/30
- [PULL 32/44] target/ppc: Convert debug to trace events (decrementer and IRQ), David Gibson, 2021/09/30
- [PULL 36/44] hw/intc: openpic: Clean up the styles, David Gibson, 2021/09/30
- [PULL 33/44] target/ppc: Fix 64-bit decrementer, David Gibson, 2021/09/30
- [PULL 31/44] spapr_numa.c: handle auto NUMA node with no distance info,
David Gibson <=
- [PULL 28/44] spapr_numa.c: rename numa_assoc_array to FORM1_assoc_array, David Gibson, 2021/09/30
- [PULL 34/44] hw/intc: openpic: Correct the reset value of IPIDR for FSL chipset, David Gibson, 2021/09/30
- [PULL 35/44] hw/intc: openpic: Drop Raven related codes, David Gibson, 2021/09/30
- [PULL 30/44] spapr_numa.c: FORM2 NUMA affinity support, David Gibson, 2021/09/30
- [PULL 37/44] spapr_numa.c: fixes in spapr_numa_FORM2_write_rtas_tables(), David Gibson, 2021/09/30
- [PULL 38/44] spapr/xive: Fix kvm_xive_source_reset trace event, David Gibson, 2021/09/30
- [PULL 39/44] MAINTAINERS: Remove machine specific files from ppc TCG CPUs entry, David Gibson, 2021/09/30
- [PULL 40/44] MAINTAINERS: Remove David & Greg as reviewers for a number of boards, David Gibson, 2021/09/30
- [PULL 41/44] MAINTAINERS: Orphan obscure ppc platforms, David Gibson, 2021/09/30
- [PULL 43/44] MAINTAINERS: Add information for OpenPIC, David Gibson, 2021/09/30