Skip to content
Snippets Groups Projects
Commit 71e6fae3 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by David Gibson
Browse files

spapr_numa.c: FORM2 table handle nodes with no distance info


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: default avatarNicholas Piggin <npiggin@gmail.com>
Message-Id: <20211105135137.1584840-1-npiggin@gmail.com>
Reviewed-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 14fe3222
No related branches found
No related tags found
No related merge requests found
......@@ -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++;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment