diff mbox

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

Message ID 1461219834-10416-3-git-send-email-zhaoshenglong@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shannon Zhao April 21, 2016, 6:23 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(+)

Comments

Andrew Jones April 22, 2016, 12:34 p.m. UTC | #1
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 mbox

Patch

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);
     }
 }