summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBharata B Rao <bharata@linux.vnet.ibm.com>2015-08-03 11:05:40 +0530
committerDavid Gibson <david@gibson.dropbear.id.au>2015-09-23 10:51:11 +1000
commit6663864e950d40c467ae4ab81c4dac64d7a8d9e6 (patch)
tree9c0aba243374d581ad2bf56731daa4426b3d9e81 /hw
parent19a35c9e1b964f420ee07141f049e6c96c63b740 (diff)
downloadqemu-6663864e950d40c467ae4ab81c4dac64d7a8d9e6.tar.gz
spapr: Populate ibm,associativity-lookup-arrays correctly for non-NUMA
When NUMA isn't configured explicitly, assume node 0 is present for the purpose of creating ibm,associativity-lookup-arrays property under ibm,dynamic-reconfiguration-memory DT node. This ensures that the associativity index property is correctly updated in ibm,dynamic-memory for the LMB that is hotplugged. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/spapr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5c81e19ac7..64d07cd634 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -724,6 +724,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
uint32_t nr_lmbs = machine->maxram_size/lmb_size - nr_rma_lmbs;
uint32_t nr_assigned_lmbs = machine->ram_size/lmb_size - nr_rma_lmbs;
uint32_t *int_buf, *cur_index, buf_len;
+ int nr_nodes = nb_numa_nodes ? nb_numa_nodes : 1;
/* Allocate enough buffer size to fit in ibm,dynamic-memory */
buf_len = nr_lmbs * SPAPR_DR_LMB_LIST_ENTRY_SIZE * sizeof(uint32_t) +
@@ -789,10 +790,10 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
/* ibm,associativity-lookup-arrays */
cur_index = int_buf;
- int_buf[0] = cpu_to_be32(nb_numa_nodes);
+ int_buf[0] = cpu_to_be32(nr_nodes);
int_buf[1] = cpu_to_be32(4); /* Number of entries per associativity list */
cur_index += 2;
- for (i = 0; i < nb_numa_nodes; i++) {
+ for (i = 0; i < nr_nodes; i++) {
uint32_t associativity[] = {
cpu_to_be32(0x0),
cpu_to_be32(0x0),