From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:46957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gr4c2-0000Z3-Po for qemu-devel@nongnu.org; Tue, 05 Feb 2019 12:34:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gr4c1-0004XW-Om for qemu-devel@nongnu.org; Tue, 05 Feb 2019 12:34:22 -0500 From: Eric Auger Date: Tue, 5 Feb 2019 18:33:01 +0100 Message-Id: <20190205173306.20483-14-eric.auger@redhat.com> In-Reply-To: <20190205173306.20483-1-eric.auger@redhat.com> References: <20190205173306.20483-1-eric.auger@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v6 13/18] hw/arm/virt-acpi-build: Add PC-DIMM in SRAT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, shameerali.kolothum.thodi@huawei.com, imammedo@redhat.com, david@redhat.com Cc: dgilbert@redhat.com, david@gibson.dropbear.id.au, drjones@redhat.com From: Shameer Kolothum Generate Memory Affinity Structures for PC-DIMM ranges. Signed-off-by: Shameer Kolothum Signed-off-by: Eric Auger --- v5 -> v6: - fix mingw compil issue v4 -> v5: - Align to x86 code and especially "pc: acpi: revert back to 1 SRAT entry for hotpluggable area" v3 -> v4: - do not use vms->bootinfo.device_memory_start/device_memory_size anymore v1 -> v2: - build_srat_hotpluggable_memory movedc to aml-build --- hw/arm/virt-acpi-build.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 829d2f0035..781eafaf5e 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -516,6 +516,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) int i, srat_start; uint64_t mem_base; MachineClass *mc =3D MACHINE_GET_CLASS(vms); + MachineState *ms =3D MACHINE(vms); const CPUArchIdList *cpu_list =3D mc->possible_cpu_arch_ids(MACHINE(= vms)); =20 srat_start =3D table_data->len; @@ -541,6 +542,14 @@ build_srat(GArray *table_data, BIOSLinker *linker, V= irtMachineState *vms) } } =20 + if (ms->device_memory) { + numamem =3D acpi_data_push(table_data, sizeof *numamem); + build_srat_memory(numamem, ms->device_memory->base, + memory_region_size(&ms->device_memory->mr), + nb_numa_nodes - 1, + MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABL= ED); + } + build_header(linker, table_data, (void *)(table_data->data + srat_st= art), "SRAT", table_data->len - srat_start, 3, NULL, NULL); } --=20 2.20.1