Message ID | 1461219834-10416-3-git-send-email-zhaoshenglong@huawei.com |
---|---|
State | New |
Headers | show |
On Thu, Apr 21, 2016 at 02:23:51PM +0800, Shannon Zhao wrote: > 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(+) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 814a1eb..d21e9a0 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -359,6 +359,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 > @@ -408,6 +409,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); > } > } > -- > 2.0.4 > Reviewed-by: Andrew Jones <drjones@redhat.com>
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 814a1eb..d21e9a0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -359,6 +359,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 @@ -408,6 +409,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); } }