[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 54/54] spapr_numa.c: FORM2 table handle nodes with no distance inf
From: |
David Gibson |
Subject: |
[PULL 54/54] spapr_numa.c: FORM2 table handle nodes with no distance info |
Date: |
Tue, 9 Nov 2021 16:52:04 +1100 |
From: Nicholas Piggin <npiggin@gmail.com>
A configuration that specifies multiple nodes without distance info
results in the non-local points in the FORM2 matrix having a distance of
0. This causes Linux to complain "Invalid distance value range" because
a node distance is smaller than the local distance.
Fix this by building a simple local / remote fallback for points where
distance information is missing.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20211105135137.1584840-1-npiggin@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr_numa.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr_numa.c b/hw/ppc/spapr_numa.c
index 5822938448..56ab2a5fb6 100644
--- a/hw/ppc/spapr_numa.c
+++ b/hw/ppc/spapr_numa.c
@@ -546,12 +546,24 @@ static void
spapr_numa_FORM2_write_rtas_tables(SpaprMachineState *spapr,
* NUMA nodes, but QEMU adds the default NUMA node without
* adding the numa_info to retrieve distance info from.
*/
- if (src == dst) {
- distance_table[i++] = NUMA_DISTANCE_MIN;
- continue;
+ distance_table[i] = numa_info[src].distance[dst];
+ if (distance_table[i] == 0) {
+ /*
+ * In case QEMU adds a default NUMA single node when the user
+ * did not add any, or where the user did not supply distances,
+ * the value will be 0 here. Populate the table with a fallback
+ * simple local / remote distance.
+ */
+ if (src == dst) {
+ distance_table[i] = NUMA_DISTANCE_MIN;
+ } else {
+ distance_table[i] = numa_info[src].distance[dst];
+ if (distance_table[i] < NUMA_DISTANCE_MIN) {
+ distance_table[i] = NUMA_DISTANCE_DEFAULT;
+ }
+ }
}
-
- distance_table[i++] = numa_info[src].distance[dst];
+ i++;
}
}
--
2.33.1
- [PULL 43/54] target/ppc: added the instructions PLXV and PSTXV, (continued)
- [PULL 43/54] target/ppc: added the instructions PLXV and PSTXV, David Gibson, 2021/11/09
- [PULL 49/54] target/ppc: implemented XXSPLTIDP instruction, David Gibson, 2021/11/09
- [PULL 44/54] target/ppc: added the instructions PLXVP and PSTXVP, David Gibson, 2021/11/09
- [PULL 47/54] target/ppc: implemented XXSPLTI32DX, David Gibson, 2021/11/09
- [PULL 45/54] target/ppc: moved XXSPLTW to using decodetree, David Gibson, 2021/11/09
- [PULL 46/54] target/ppc: moved XXSPLTIB to using decodetree, David Gibson, 2021/11/09
- [PULL 50/54] target/ppc: Implement xxblendvb/xxblendvh/xxblendvw/xxblendvd instructions, David Gibson, 2021/11/09
- [PULL 51/54] target/ppc: Implement lxvkq instruction, David Gibson, 2021/11/09
- [PULL 52/54] target/ppc: cntlzdm/cnttzdm implementation without brcond, David Gibson, 2021/11/09
- [PULL 53/54] target/ppc, hw/ppc: Change maintainers, David Gibson, 2021/11/09
- [PULL 54/54] spapr_numa.c: FORM2 table handle nodes with no distance info,
David Gibson <=
- Re: [PULL 00/54] ppc-for-6.2 queue 20211109, Richard Henderson, 2021/11/09