diff mbox

[v4,2/5] ARM: Virt: Set numa-node-id for CPUs

Message ID 1453549006-16044-3-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao Jan. 23, 2016, 11:36 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>


Add a numa-node-id property to specify NUMA information for CPUs.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>

---
 hw/arm/virt.c | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
2.0.4
diff mbox

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c725e29..14265b1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -335,6 +335,7 @@  static void fdt_add_cpu_nodes(const VirtBoardInfo *vbi)
 {
     int cpu;
     int addr_cells = 1;
+    unsigned int i;
 
     /*
      * From Documentation/devicetree/bindings/arm/cpus.txt
@@ -384,6 +385,12 @@  static void fdt_add_cpu_nodes(const VirtBoardInfo *vbi)
                                   armcpu->mp_affinity);
         }
 
+        for (i = 0; i < nb_numa_nodes; i++) {
+            if (test_bit(cpu, numa_info[i].node_cpu)) {
+                qemu_fdt_setprop_cell(vbi->fdt, nodename, "numa-node-id", i);
+            }
+        }
+
         g_free(nodename);
     }
 }