From nobody Sun Apr 28 23:54:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496079576590656.9885422798264; Mon, 29 May 2017 10:39:36 -0700 (PDT) Received: from localhost ([::1]:49811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFOdh-0006Od-Cc for importer@patchew.org; Mon, 29 May 2017 13:39:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFOcE-0005M0-Uy for qemu-devel@nongnu.org; Mon, 29 May 2017 13:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFOcE-0002SA-3W for qemu-devel@nongnu.org; Mon, 29 May 2017 13:38:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54104) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFOc9-0002Nk-BL; Mon, 29 May 2017 13:37:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2437CC057FA7; Mon, 29 May 2017 17:37:56 +0000 (UTC) Received: from kamzik.brq.redhat.com (kamzik.brq.redhat.com [10.34.1.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB27017A9B; Mon, 29 May 2017 17:37:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2437CC057FA7 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=drjones@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2437CC057FA7 From: Andrew Jones To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Mon, 29 May 2017 19:37:50 +0200 Message-Id: <20170529173751.3443-2-drjones@redhat.com> In-Reply-To: <20170529173751.3443-1-drjones@redhat.com> References: <20170529173751.3443-1-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 29 May 2017 17:37:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: build SLIT when needed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, zhaoshenglong@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: Shannon Zhao Signed-off-by: Andrew Jones Reviewed-by: Igor Mammedov Reviewed-by: Shannon Zhao --- 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, AcpiBuildT= ables *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); + } } =20 if (its_class_name() && !vmc->no_its) { --=20 2.9.4 From nobody Sun Apr 28 23:54:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496079608834929.3860449268368; Mon, 29 May 2017 10:40:08 -0700 (PDT) Received: from localhost ([::1]:49813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFOeE-0006oG-CP for importer@patchew.org; Mon, 29 May 2017 13:40:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFOcE-0005M1-W9 for qemu-devel@nongnu.org; Mon, 29 May 2017 13:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFOcE-0002SF-58 for qemu-devel@nongnu.org; Mon, 29 May 2017 13:38:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45816) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFOcA-0002OI-NL; Mon, 29 May 2017 13:37:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8BF8CC049D57; Mon, 29 May 2017 17:37:57 +0000 (UTC) Received: from kamzik.brq.redhat.com (kamzik.brq.redhat.com [10.34.1.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6494060BE2; Mon, 29 May 2017 17:37:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8BF8CC049D57 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=drjones@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8BF8CC049D57 From: Andrew Jones To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Mon, 29 May 2017 19:37:51 +0200 Message-Id: <20170529173751.3443-3-drjones@redhat.com> In-Reply-To: <20170529173751.3443-1-drjones@redhat.com> References: <20170529173751.3443-1-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 29 May 2017 17:37:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] hw/arm/virt: fdt: generate distance-map when needed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, zhaoshenglong@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is based on patch Shannon Zhao originally posted. Cc: Shannon Zhao Signed-off-by: Andrew Jones Reviewed-by: Shannon Zhao --- 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); =20 + if (have_numa_distance) { + int size =3D nb_numa_nodes * nb_numa_nodes * 3 * sizeof(uint32_t); + uint32_t *matrix =3D g_malloc0(size); + int idx, i, j; + + for (i =3D 0; i < nb_numa_nodes; i++) { + for (j =3D 0; j < nb_numa_nodes; j++) { + idx =3D (i * nb_numa_nodes + j) * 3; + matrix[idx + 0] =3D cpu_to_be32(i); + matrix[idx + 1] =3D cpu_to_be32(j); + matrix[idx + 2] =3D 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); + } } =20 static void fdt_add_psci_node(const VirtMachineState *vms) --=20 2.9.4