From nobody Tue Oct 28 01:50:41 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527680917966551.7470712307739; Wed, 30 May 2018 04:48:37 -0700 (PDT) Received: from localhost ([::1]:37761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNzam-0006Rw-Ss for importer@patchew.org; Wed, 30 May 2018 07:48:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNzYQ-0004w7-52 for qemu-devel@nongnu.org; Wed, 30 May 2018 07:46:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNzYP-0005Ew-C5 for qemu-devel@nongnu.org; Wed, 30 May 2018 07:46:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38306 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNzYL-0005Cb-IG; Wed, 30 May 2018 07:46:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FEA5BB40D; Wed, 30 May 2018 11:46:05 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C0D010EE6C1; Wed, 30 May 2018 11:46:03 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org Date: Wed, 30 May 2018 13:45:39 +0200 Message-Id: <1527680741-2725-7-git-send-email-eric.auger@redhat.com> In-Reply-To: <1527680741-2725-1-git-send-email-eric.auger@redhat.com> References: <1527680741-2725-1-git-send-email-eric.auger@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 30 May 2018 11:46:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 30 May 2018 11:46:05 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eric.auger@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [RFC v3 6/8] hw/arm/virt-acpi-build: Advertise one or two GICR structures 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: marc.zyngier@arm.com, wei@redhat.com, drjones@redhat.com, christoffer.dall@arm.com, 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" Depending on the number of smp_cpus we now register one or two GICR structures. Signed-off-by: Eric Auger --- 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 92ceee9..6a4340a 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -660,6 +660,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) =20 if (vms->gic_version =3D=3D 3) { AcpiMadtGenericTranslator *gic_its; + int nb_redist_regions =3D virt_gicv3_redist_region_count(vms); AcpiMadtGenericRedistributor *gicr =3D acpi_data_push(table_data, sizeof *gicr); =20 @@ -668,6 +669,14 @@ build_madt(GArray *table_data, BIOSLinker *linker, Vir= tMachineState *vms) gicr->base_address =3D cpu_to_le64(memmap[VIRT_GIC_REDIST].base); gicr->range_length =3D cpu_to_le32(memmap[VIRT_GIC_REDIST].size); =20 + if (nb_redist_regions =3D=3D 2) { + gicr =3D acpi_data_push(table_data, sizeof(*gicr)); + gicr->type =3D ACPI_APIC_GENERIC_REDISTRIBUTOR; + gicr->length =3D sizeof(*gicr); + gicr->base_address =3D cpu_to_le64(memmap[VIRT_GIC_REDIST2].ba= se); + gicr->range_length =3D cpu_to_le32(memmap[VIRT_GIC_REDIST2].si= ze); + } + if (its_class_name() && !vmc->no_its) { gic_its =3D acpi_data_push(table_data, sizeof *gic_its); gic_its->type =3D ACPI_APIC_GENERIC_TRANSLATOR; --=20 2.5.5