All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info when needed
@ 2017-05-29 17:37 Andrew Jones
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT " Andrew Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrew Jones @ 2017-05-29 17:37 UTC (permalink / raw)
  To: qemu-devel, qemu-arm; +Cc: zhaoshenglong, peter.maydell

Andrew Jones (2):
  hw/arm/virt-acpi-build: build SLIT when needed
  hw/arm/virt: fdt: generate distance-map when needed

 hw/arm/virt-acpi-build.c |  4 ++++
 hw/arm/virt.c            | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)

-- 
2.9.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT when needed
  2017-05-29 17:37 [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info when needed Andrew Jones
@ 2017-05-29 17:37 ` Andrew Jones
  2017-05-30  6:58   ` Igor Mammedov
  2017-05-31  1:17   ` Shannon Zhao
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 2/2] hw/arm/virt: fdt: generate distance-map " Andrew Jones
  2017-06-01 16:28 ` [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info " Peter Maydell
  2 siblings, 2 replies; 7+ messages in thread
From: Andrew Jones @ 2017-05-29 17:37 UTC (permalink / raw)
  To: qemu-devel, qemu-arm; +Cc: zhaoshenglong, peter.maydell

Cc: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 hw/arm/virt-acpi-build.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index e5852067f5bd..2079828c22a4 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -776,6 +776,10 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
     if (nb_numa_nodes > 0) {
         acpi_add_table(table_offsets, tables_blob);
         build_srat(tables_blob, tables->linker, vms);
+        if (have_numa_distance) {
+            acpi_add_table(table_offsets, tables_blob);
+            build_slit(tables_blob, tables->linker);
+        }
     }
 
     if (its_class_name() && !vmc->no_its) {
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/2] hw/arm/virt: fdt: generate distance-map when needed
  2017-05-29 17:37 [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info when needed Andrew Jones
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT " Andrew Jones
@ 2017-05-29 17:37 ` Andrew Jones
  2017-05-31  1:16   ` Shannon Zhao
  2017-06-01 16:28 ` [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info " Peter Maydell
  2 siblings, 1 reply; 7+ messages in thread
From: Andrew Jones @ 2017-05-29 17:37 UTC (permalink / raw)
  To: qemu-devel, qemu-arm; +Cc: zhaoshenglong, peter.maydell

This is based on patch Shannon Zhao originally posted.

Cc: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 hw/arm/virt.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c7c8159dfd59..4db2d4207cf2 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -219,6 +219,27 @@ static void create_fdt(VirtMachineState *vms)
                                 "clk24mhz");
     qemu_fdt_setprop_cell(fdt, "/apb-pclk", "phandle", vms->clock_phandle);
 
+    if (have_numa_distance) {
+        int size = nb_numa_nodes * nb_numa_nodes * 3 * sizeof(uint32_t);
+        uint32_t *matrix = g_malloc0(size);
+        int idx, i, j;
+
+        for (i = 0; i < nb_numa_nodes; i++) {
+            for (j = 0; j < nb_numa_nodes; j++) {
+                idx = (i * nb_numa_nodes + j) * 3;
+                matrix[idx + 0] = cpu_to_be32(i);
+                matrix[idx + 1] = cpu_to_be32(j);
+                matrix[idx + 2] = cpu_to_be32(numa_info[i].distance[j]);
+            }
+        }
+
+        qemu_fdt_add_subnode(fdt, "/distance-map");
+        qemu_fdt_setprop_string(fdt, "/distance-map", "compatible",
+                                "numa-distance-map-v1");
+        qemu_fdt_setprop(fdt, "/distance-map", "distance-matrix",
+                         matrix, size);
+        g_free(matrix);
+    }
 }
 
 static void fdt_add_psci_node(const VirtMachineState *vms)
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT when needed
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT " Andrew Jones
@ 2017-05-30  6:58   ` Igor Mammedov
  2017-05-31  1:17   ` Shannon Zhao
  1 sibling, 0 replies; 7+ messages in thread
From: Igor Mammedov @ 2017-05-30  6:58 UTC (permalink / raw)
  To: Andrew Jones; +Cc: qemu-devel, qemu-arm, peter.maydell, zhaoshenglong

On Mon, 29 May 2017 19:37:50 +0200
Andrew Jones <drjones@redhat.com> wrote:

> Cc: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/arm/virt-acpi-build.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index e5852067f5bd..2079828c22a4 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -776,6 +776,10 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
>      if (nb_numa_nodes > 0) {
>          acpi_add_table(table_offsets, tables_blob);
>          build_srat(tables_blob, tables->linker, vms);
> +        if (have_numa_distance) {
> +            acpi_add_table(table_offsets, tables_blob);
> +            build_slit(tables_blob, tables->linker);
> +        }
>      }
>  
>      if (its_class_name() && !vmc->no_its) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] hw/arm/virt: fdt: generate distance-map when needed
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 2/2] hw/arm/virt: fdt: generate distance-map " Andrew Jones
@ 2017-05-31  1:16   ` Shannon Zhao
  0 siblings, 0 replies; 7+ messages in thread
From: Shannon Zhao @ 2017-05-31  1:16 UTC (permalink / raw)
  To: Andrew Jones, qemu-devel, qemu-arm; +Cc: peter.maydell



On 2017/5/30 1:37, Andrew Jones wrote:
> This is based on patch Shannon Zhao originally posted.
> 
> Cc: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>

> ---
>  hw/arm/virt.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index c7c8159dfd59..4db2d4207cf2 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -219,6 +219,27 @@ static void create_fdt(VirtMachineState *vms)
>                                  "clk24mhz");
>      qemu_fdt_setprop_cell(fdt, "/apb-pclk", "phandle", vms->clock_phandle);
>  
> +    if (have_numa_distance) {
> +        int size = nb_numa_nodes * nb_numa_nodes * 3 * sizeof(uint32_t);
> +        uint32_t *matrix = g_malloc0(size);
> +        int idx, i, j;
> +
> +        for (i = 0; i < nb_numa_nodes; i++) {
> +            for (j = 0; j < nb_numa_nodes; j++) {
> +                idx = (i * nb_numa_nodes + j) * 3;
> +                matrix[idx + 0] = cpu_to_be32(i);
> +                matrix[idx + 1] = cpu_to_be32(j);
> +                matrix[idx + 2] = cpu_to_be32(numa_info[i].distance[j]);
> +            }
> +        }
> +
> +        qemu_fdt_add_subnode(fdt, "/distance-map");
> +        qemu_fdt_setprop_string(fdt, "/distance-map", "compatible",
> +                                "numa-distance-map-v1");
> +        qemu_fdt_setprop(fdt, "/distance-map", "distance-matrix",
> +                         matrix, size);
> +        g_free(matrix);
> +    }
>  }
>  
>  static void fdt_add_psci_node(const VirtMachineState *vms)
> 

-- 
Shannon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT when needed
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT " Andrew Jones
  2017-05-30  6:58   ` Igor Mammedov
@ 2017-05-31  1:17   ` Shannon Zhao
  1 sibling, 0 replies; 7+ messages in thread
From: Shannon Zhao @ 2017-05-31  1:17 UTC (permalink / raw)
  To: Andrew Jones, qemu-devel, qemu-arm; +Cc: peter.maydell



On 2017/5/30 1:37, Andrew Jones wrote:
> Cc: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>

> ---
>  hw/arm/virt-acpi-build.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index e5852067f5bd..2079828c22a4 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -776,6 +776,10 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
>      if (nb_numa_nodes > 0) {
>          acpi_add_table(table_offsets, tables_blob);
>          build_srat(tables_blob, tables->linker, vms);
> +        if (have_numa_distance) {
> +            acpi_add_table(table_offsets, tables_blob);
> +            build_slit(tables_blob, tables->linker);
> +        }
>      }
>  
>      if (its_class_name() && !vmc->no_its) {
> 

-- 
Shannon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info when needed
  2017-05-29 17:37 [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info when needed Andrew Jones
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT " Andrew Jones
  2017-05-29 17:37 ` [Qemu-devel] [PATCH 2/2] hw/arm/virt: fdt: generate distance-map " Andrew Jones
@ 2017-06-01 16:28 ` Peter Maydell
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2017-06-01 16:28 UTC (permalink / raw)
  To: Andrew Jones; +Cc: QEMU Developers, qemu-arm, Shannon Zhao

On 29 May 2017 at 18:37, Andrew Jones <drjones@redhat.com> wrote:
> Andrew Jones (2):
>   hw/arm/virt-acpi-build: build SLIT when needed
>   hw/arm/virt: fdt: generate distance-map when needed
>
>  hw/arm/virt-acpi-build.c |  4 ++++
>  hw/arm/virt.c            | 21 +++++++++++++++++++++
>  2 files changed, 25 insertions(+)



Applied to target-arm.next, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-01 16:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-29 17:37 [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info when needed Andrew Jones
2017-05-29 17:37 ` [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT " Andrew Jones
2017-05-30  6:58   ` Igor Mammedov
2017-05-31  1:17   ` Shannon Zhao
2017-05-29 17:37 ` [Qemu-devel] [PATCH 2/2] hw/arm/virt: fdt: generate distance-map " Andrew Jones
2017-05-31  1:16   ` Shannon Zhao
2017-06-01 16:28 ` [Qemu-devel] [PATCH 0/2] hw/arm/virt: numa: provide distance info " Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.