From nobody Thu Apr 25 08:31:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642170939587361.7467141189593; Fri, 14 Jan 2022 06:35:39 -0800 (PST) Received: from localhost ([::1]:42886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8Ng0-0004FL-NH for importer@patchew.org; Fri, 14 Jan 2022 09:35:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFY-0006iv-Cb for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:16 -0500 Received: from [2604:1380:4601:e00::1] (port=44100 helo=ams.source.kernel.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFV-0002pw-Pe for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F343DB825EE; Fri, 14 Jan 2022 14:08:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9017C36AEC; Fri, 14 Jan 2022 14:08:04 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=hot-poop.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n8NFK-000V8K-VE; Fri, 14 Jan 2022 14:08:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642169284; bh=EJPREJ2hbzrlmOKbYFYOpDsisqpwtXTDNLV0Fhn5LAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aLHdlj9DKlj4+sO9BXEHhwwSBp6gqdTcDBLK2INrjs5YZwjNzg5nEnNoejnTn0VRE vmeGcCnK0zLUiSh8dBPKG6b6G826Y9WaEqTKrjVMEQ420vNmJQUYQoE4VWn/nMQHEB Erf9OD8H8YdWuJrRDTvsKa3KI1d8rk/TDpqH7lJOXM8IfGyJvZk/N7b0PKvQmUqMyK CC7OtRs1R4Rx+idzZ1Rtn3M57n1mZeH29Vb4IJ9BAYUt8zYbjk3ZkXeAMQd2iEVpE3 1QY5k2leYKTtAD4y0d3vjsVevNUsVY8LC7zYdSNLxx7LaIjI9nXnYmOv8NPsF9LtTQ SgiTufwnzujHQ== From: Marc Zyngier To: qemu-devel@nongnu.org Subject: [PATCH v5 1/6] hw/arm/virt: Add a control for the the highmem PCIe MMIO Date: Fri, 14 Jan 2022 14:07:36 +0000 Message-Id: <20220114140741.1358263-2-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220114140741.1358263-1-maz@kernel.org> References: <20220114140741.1358263-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qemu-devel@nongnu.org, drjones@redhat.com, eric.auger@redhat.com, peter.maydell@linaro.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Host-Lookup-Failed: Reverse DNS lookup failed for 2604:1380:4601:e00::1 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2604:1380:4601:e00::1; envelope-from=maz@kernel.org; helo=ams.source.kernel.org X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.595, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , kvm@vger.kernel.org, Eric Auger , kernel-team@android.com, kvmarm@lists.cs.columbia.edu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642170942054100001 Content-Type: text/plain; charset="utf-8" Just like we can control the enablement of the highmem PCIe ECAM region using highmem_ecam, let's add a control for the highmem PCIe MMIO region. Similarily to highmem_ecam, this region is disabled when highmem is off. Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger --- hw/arm/virt-acpi-build.c | 10 ++++------ hw/arm/virt.c | 7 +++++-- include/hw/arm/virt.h | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index f2514ce77c..449fab0080 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -158,10 +158,9 @@ static void acpi_dsdt_add_virtio(Aml *scope, } =20 static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, - uint32_t irq, bool use_highmem, bool highmem= _ecam, - VirtMachineState *vms) + uint32_t irq, VirtMachineState *vms) { - int ecam_id =3D VIRT_ECAM_ID(highmem_ecam); + int ecam_id =3D VIRT_ECAM_ID(vms->highmem_ecam); struct GPEXConfig cfg =3D { .mmio32 =3D memmap[VIRT_PCIE_MMIO], .pio =3D memmap[VIRT_PCIE_PIO], @@ -170,7 +169,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapE= ntry *memmap, .bus =3D vms->bus, }; =20 - if (use_highmem) { + if (vms->highmem_mmio) { cfg.mmio64 =3D memmap[VIRT_HIGH_PCIE_MMIO]; } =20 @@ -869,8 +868,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]); acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO], (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPO= RTS); - acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), - vms->highmem, vms->highmem_ecam, vms); + acpi_dsdt_add_pci(scope, memmap, irqmap[VIRT_PCIE] + ARM_SPI_BASE, vms= ); if (vms->acpi_dev) { build_ged_aml(scope, "\\_SB."GED_DEVICE, HOTPLUG_HANDLER(vms->acpi_dev), diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b45b52c90e..ed8ea96acc 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1412,7 +1412,7 @@ static void create_pcie(VirtMachineState *vms) mmio_reg, base_mmio, size_mmio); memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias= ); =20 - if (vms->highmem) { + if (vms->highmem_mmio) { /* Map high MMIO space */ MemoryRegion *high_mmio_alias =3D g_new0(MemoryRegion, 1); =20 @@ -1466,7 +1466,7 @@ static void create_pcie(VirtMachineState *vms) qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base_ecam, 2, size_ecam); =20 - if (vms->highmem) { + if (vms->highmem_mmio) { qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", 1, FDT_PCI_RANGE_IOPORT, 2, 0, 2, base_pio, 2, size_pio, @@ -2105,6 +2105,8 @@ static void machvirt_init(MachineState *machine) =20 virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem); =20 + vms->highmem_mmio &=3D vms->highmem; + create_gic(vms, sysmem); =20 virt_cpu_post_init(vms, sysmem); @@ -2802,6 +2804,7 @@ static void virt_instance_init(Object *obj) vms->gic_version =3D VIRT_GIC_VERSION_NOSEL; =20 vms->highmem_ecam =3D !vmc->no_highmem_ecam; + vms->highmem_mmio =3D true; =20 if (vmc->no_its) { vms->its =3D false; diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index dc6b66ffc8..9c54acd10d 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -143,6 +143,7 @@ struct VirtMachineState { bool secure; bool highmem; bool highmem_ecam; + bool highmem_mmio; bool its; bool tcg_its; bool virt; --=20 2.30.2 From nobody Thu Apr 25 08:31:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642170851952421.0219447331667; Fri, 14 Jan 2022 06:34:11 -0800 (PST) Received: from localhost ([::1]:41222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8Ned-0002yu-0w for importer@patchew.org; Fri, 14 Jan 2022 09:34:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFZ-0006mh-CZ for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:17 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:48435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFX-0002pz-74 for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 63DE4B825F0; Fri, 14 Jan 2022 14:08:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE03FC36AEB; Fri, 14 Jan 2022 14:08:04 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=hot-poop.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n8NFL-000V8K-4r; Fri, 14 Jan 2022 14:08:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642169285; bh=J8p1oxs0nGeqlmSeGlBKYJ/X1YzIZyUNxK+ulWeNgNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uzZVZG9r6kp9C6WrM852w7CrdnR6PIprAum1ZCKr0ha8doJG/DgXpTaYYZ0ZtnZW3 41xEFtpcFW1krQaIQbsnj1NAKlXC1WQWY4x+CYGp9g3DyhBrOZNpoHgrc3FkN3MDM4 UUYcZgX0GrXnyqNqx5gqO7Cim7kxJBfflirfHXE2SAZHfjz37bSizl4vafFsBP9Un+ 5UtOWZaZbIK/EWChdDNwauT2H1trmipqL76O0exnWk49lhTEhOxaq09xe+T/+rWKDR e94FsetCYNweu5D01zuU+AG5oOcZoUWKq2kFvSQj1rFHyMfg5KS/BB/N/NxYNLBGnb JOhLLzyvpDe7A== From: Marc Zyngier To: qemu-devel@nongnu.org Subject: [PATCH v5 2/6] hw/arm/virt: Add a control for the the highmem redistributors Date: Fri, 14 Jan 2022 14:07:37 +0000 Message-Id: <20220114140741.1358263-3-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220114140741.1358263-1-maz@kernel.org> References: <20220114140741.1358263-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qemu-devel@nongnu.org, drjones@redhat.com, eric.auger@redhat.com, peter.maydell@linaro.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=145.40.68.75; envelope-from=maz@kernel.org; helo=ams.source.kernel.org X-Spam_score_int: -76 X-Spam_score: -7.7 X-Spam_bar: ------- X-Spam_report: (-7.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.595, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , kvm@vger.kernel.org, Eric Auger , kernel-team@android.com, kvmarm@lists.cs.columbia.edu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642170853572100001 Content-Type: text/plain; charset="utf-8" Just like we can control the enablement of the highmem PCIe region using highmem_ecam, let's add a control for the highmem GICv3 redistributor region. Similarily to highmem_ecam, these redistributors are disabled when highmem is off. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger --- hw/arm/virt-acpi-build.c | 2 ++ hw/arm/virt.c | 2 ++ include/hw/arm/virt.h | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 449fab0080..0757c28f69 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -947,6 +947,8 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTa= bles *tables) acpi_add_table(table_offsets, tables_blob); build_fadt_rev5(tables_blob, tables->linker, vms, dsdt); =20 + vms->highmem_redists &=3D vms->highmem; + acpi_add_table(table_offsets, tables_blob); build_madt(tables_blob, tables->linker, vms); =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ed8ea96acc..e734a75850 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2106,6 +2106,7 @@ static void machvirt_init(MachineState *machine) virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem); =20 vms->highmem_mmio &=3D vms->highmem; + vms->highmem_redists &=3D vms->highmem; =20 create_gic(vms, sysmem); =20 @@ -2805,6 +2806,7 @@ static void virt_instance_init(Object *obj) =20 vms->highmem_ecam =3D !vmc->no_highmem_ecam; vms->highmem_mmio =3D true; + vms->highmem_redists =3D true; =20 if (vmc->no_its) { vms->its =3D false; diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 9c54acd10d..dc9fa26faa 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -144,6 +144,7 @@ struct VirtMachineState { bool highmem; bool highmem_ecam; bool highmem_mmio; + bool highmem_redists; bool its; bool tcg_its; bool virt; @@ -190,7 +191,8 @@ static inline int virt_gicv3_redist_region_count(VirtMa= chineState *vms) =20 assert(vms->gic_version =3D=3D VIRT_GIC_VERSION_3); =20 - return MACHINE(vms)->smp.cpus > redist0_capacity ? 2 : 1; + return (MACHINE(vms)->smp.cpus > redist0_capacity && + vms->highmem_redists) ? 2 : 1; } =20 #endif /* QEMU_ARM_VIRT_H */ --=20 2.30.2 From nobody Thu Apr 25 08:31:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642170781131566.477624046367; Fri, 14 Jan 2022 06:33:01 -0800 (PST) Received: from localhost ([::1]:36262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8NdT-0007d4-Rt for importer@patchew.org; Fri, 14 Jan 2022 09:32:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFY-0006if-Co for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:16 -0500 Received: from [2604:1380:4641:c500::1] (port=45840 helo=dfw.source.kernel.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFV-0002pO-Pf for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:15 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AA51C61C7A; Fri, 14 Jan 2022 14:08:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17A00C36AEF; Fri, 14 Jan 2022 14:08:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=hot-poop.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n8NFL-000V8K-9z; Fri, 14 Jan 2022 14:08:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642169285; bh=nAblTk6IMLqx5QlaZTT3XwmgPRTylGTb8UUfnkLW9S8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nmLLmF7g6b3bmG9mVpYoGxv3DQZXs99KYqXN1LZPtgkYkCdBy4J9LjTrARHX/ckmS pzglD1YgV406lpRMltInTPK0+g6n0ORZRoGArps3XjHF77DznIe0NtYUxGBu+9C99q UInDn12rX3AvUj/TRicDmWv+Us2huu2Rw/bVob1GuNviccjWfQwkzR68dxt5n94Jo5 9kmGBxNAAbeiD3cj7n6kaarADfx8sqUj0zkUJywIg8GibH3+CFmtETO/WuWzXN+q3r vQZr6kFxAOjWIX4XKgFrIFRXzQAOzPwbemnaS1QrtS5B4Z9AIH2JKhmac12QZ9qvYu P/NQJBGZj6yhA== From: Marc Zyngier To: qemu-devel@nongnu.org Subject: [PATCH v5 3/6] hw/arm/virt: Honor highmem setting when computing the memory map Date: Fri, 14 Jan 2022 14:07:38 +0000 Message-Id: <20220114140741.1358263-4-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220114140741.1358263-1-maz@kernel.org> References: <20220114140741.1358263-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qemu-devel@nongnu.org, drjones@redhat.com, eric.auger@redhat.com, peter.maydell@linaro.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Host-Lookup-Failed: Reverse DNS lookup failed for 2604:1380:4641:c500::1 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=maz@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.595, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , kvm@vger.kernel.org, Eric Auger , kernel-team@android.com, kvmarm@lists.cs.columbia.edu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642170782956100001 Content-Type: text/plain; charset="utf-8" Even when the VM is configured with highmem=3Doff, the highest_gpa field includes devices that are above the 4GiB limit. Similarily, nothing seem to check that the memory is within the limit set by the highmem=3Doff option. This leads to failures in virt_kvm_type() on systems that have a crippled IPA range, as the reported IPA space is larger than what it should be. Instead, honor the user-specified limit to only use the devices at the lowest end of the spectrum, and fail if we have memory crossing the 4GiB limit. Reviewed-by: Andrew Jones Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e734a75850..ecc3e3e5b0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1663,7 +1663,7 @@ static uint64_t virt_cpu_mp_affinity(VirtMachineState= *vms, int idx) static void virt_set_memmap(VirtMachineState *vms) { MachineState *ms =3D MACHINE(vms); - hwaddr base, device_memory_base, device_memory_size; + hwaddr base, device_memory_base, device_memory_size, memtop; int i; =20 vms->memmap =3D extended_memmap; @@ -1690,7 +1690,11 @@ static void virt_set_memmap(VirtMachineState *vms) device_memory_size =3D ms->maxram_size - ms->ram_size + ms->ram_slots = * GiB; =20 /* Base address of the high IO region */ - base =3D device_memory_base + ROUND_UP(device_memory_size, GiB); + memtop =3D base =3D device_memory_base + ROUND_UP(device_memory_size, = GiB); + if (!vms->highmem && memtop > 4 * GiB) { + error_report("highmem=3Doff, but memory crosses the 4GiB limit\n"); + exit(EXIT_FAILURE); + } if (base < device_memory_base) { error_report("maxmem/slots too huge"); exit(EXIT_FAILURE); @@ -1707,7 +1711,7 @@ static void virt_set_memmap(VirtMachineState *vms) vms->memmap[i].size =3D size; base +=3D size; } - vms->highest_gpa =3D base - 1; + vms->highest_gpa =3D (vms->highmem ? base : memtop) - 1; if (device_memory_size > 0) { ms->device_memory =3D g_malloc0(sizeof(*ms->device_memory)); ms->device_memory->base =3D device_memory_base; --=20 2.30.2 From nobody Thu Apr 25 08:31:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642170693773532.3246695144283; Fri, 14 Jan 2022 06:31:33 -0800 (PST) Received: from localhost ([::1]:34004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8Nc4-0005bc-P6 for importer@patchew.org; Fri, 14 Jan 2022 09:31:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFZ-0006mq-Dd for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:17 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:48434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFX-0002q0-75 for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A1701B825F8; Fri, 14 Jan 2022 14:08:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 429ADC36AF2; Fri, 14 Jan 2022 14:08:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=hot-poop.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n8NFL-000V8K-F7; Fri, 14 Jan 2022 14:08:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642169285; bh=o+84v8AARuSDTfw6kHuIEO2OrH3GI/MMeSuFgurdj1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qc6SmWkoKVcx8o0bOy9uAYWeEjW8ievv8uYEERxjKrKR0HGm7XGubAp1wxqE33I6u yc9kXHN8mylAu+G42Y6ux3Hgk47kpmFzgXawWbB5TsYlN6rtdPNwI8NCNGWla1fy1m vMObs3vivLwAegCR9BCgu4LmOE6cLh3zxQa57bfn2bxUOYBETZaKszWJQeydw/pPR0 AwDpBCRv1WyJhEIhaawvcdp5qW2fh4lT2qdCFUJvRutjxH2nvgV36pLkCZ5WjQp+Zb LQKwCxKEfZmMbnHISS/W1swH4IyEsqsZ/IpOh8qrDyfLkvmJmdtM4bImUR+ajP7Q0k 5NEkuQMNWLHew== From: Marc Zyngier To: qemu-devel@nongnu.org Subject: [PATCH v5 4/6] hw/arm/virt: Use the PA range to compute the memory map Date: Fri, 14 Jan 2022 14:07:39 +0000 Message-Id: <20220114140741.1358263-5-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220114140741.1358263-1-maz@kernel.org> References: <20220114140741.1358263-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qemu-devel@nongnu.org, drjones@redhat.com, eric.auger@redhat.com, peter.maydell@linaro.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=145.40.68.75; envelope-from=maz@kernel.org; helo=ams.source.kernel.org X-Spam_score_int: -76 X-Spam_score: -7.7 X-Spam_bar: ------- X-Spam_report: (-7.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.595, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , kvm@vger.kernel.org, Eric Auger , kernel-team@android.com, kvmarm@lists.cs.columbia.edu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642170696141100001 Content-Type: text/plain; charset="utf-8" The highmem attribute is nothing but another way to express the PA range of a VM. To support HW that has a smaller PA range then what QEMU assumes, pass this PA range to the virt_set_memmap() function, allowing it to correctly exclude highmem devices if they are outside of the PA range. Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger --- hw/arm/virt.c | 64 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ecc3e3e5b0..a427676b50 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1660,7 +1660,7 @@ static uint64_t virt_cpu_mp_affinity(VirtMachineState= *vms, int idx) return arm_cpu_mp_affinity(idx, clustersz); } =20 -static void virt_set_memmap(VirtMachineState *vms) +static void virt_set_memmap(VirtMachineState *vms, int pa_bits) { MachineState *ms =3D MACHINE(vms); hwaddr base, device_memory_base, device_memory_size, memtop; @@ -1678,6 +1678,14 @@ static void virt_set_memmap(VirtMachineState *vms) exit(EXIT_FAILURE); } =20 + /* + * !highmem is exactly the same as limiting the PA space to 32bit, + * irrespective of the underlying capabilities of the HW. + */ + if (!vms->highmem) { + pa_bits =3D 32; + } + /* * We compute the base of the high IO region depending on the * amount of initial and device memory. The device memory start/size @@ -1691,8 +1699,9 @@ static void virt_set_memmap(VirtMachineState *vms) =20 /* Base address of the high IO region */ memtop =3D base =3D device_memory_base + ROUND_UP(device_memory_size, = GiB); - if (!vms->highmem && memtop > 4 * GiB) { - error_report("highmem=3Doff, but memory crosses the 4GiB limit\n"); + if (memtop > BIT_ULL(pa_bits)) { + error_report("Addressing limited to %d bits, but memory exceeds it by= %llu bytes\n", + pa_bits, memtop - BIT_ULL(pa_bits)); exit(EXIT_FAILURE); } if (base < device_memory_base) { @@ -1711,7 +1720,13 @@ static void virt_set_memmap(VirtMachineState *vms) vms->memmap[i].size =3D size; base +=3D size; } - vms->highest_gpa =3D (vms->highmem ? base : memtop) - 1; + + /* + * If base fits within pa_bits, all good. If it doesn't, limit it + * to the end of RAM, which is guaranteed to fit within pa_bits. + */ + vms->highest_gpa =3D (base <=3D BIT_ULL(pa_bits) ? base : memtop) - 1; + if (device_memory_size > 0) { ms->device_memory =3D g_malloc0(sizeof(*ms->device_memory)); ms->device_memory->base =3D device_memory_base; @@ -1902,12 +1917,43 @@ static void machvirt_init(MachineState *machine) unsigned int smp_cpus =3D machine->smp.cpus; unsigned int max_cpus =3D machine->smp.max_cpus; =20 + if (!cpu_type_valid(machine->cpu_type)) { + error_report("mach-virt: CPU type %s not supported", machine->cpu_= type); + exit(1); + } + + possible_cpus =3D mc->possible_cpu_arch_ids(machine); + /* * In accelerated mode, the memory map is computed earlier in kvm_type= () * to create a VM with the right number of IPA bits. */ if (!vms->memmap) { - virt_set_memmap(vms); + Object *cpuobj; + ARMCPU *armcpu; + int pa_bits; + + /* + * Instanciate a temporary CPU object to find out about what + * we are about to deal with. Once this is done, get rid of + * the object. + */ + cpuobj =3D object_new(possible_cpus->cpus[0].type); + armcpu =3D ARM_CPU(cpuobj); + + if (object_property_get_bool(cpuobj, "aarch64", NULL)) { + pa_bits =3D arm_pamax(armcpu); + } else if (arm_feature(&armcpu->env, ARM_FEATURE_LPAE)) { + /* v7 with LPAE */ + pa_bits =3D 40; + } else { + /* Anything else */ + pa_bits =3D 32; + } + + object_unref(cpuobj); + + virt_set_memmap(vms, pa_bits); } =20 /* We can probe only here because during property set @@ -1915,11 +1961,6 @@ static void machvirt_init(MachineState *machine) */ finalize_gic_version(vms); =20 - if (!cpu_type_valid(machine->cpu_type)) { - error_report("mach-virt: CPU type %s not supported", machine->cpu_= type); - exit(1); - } - if (vms->secure) { /* * The Secure view of the world is the same as the NonSecure, @@ -1989,7 +2030,6 @@ static void machvirt_init(MachineState *machine) =20 create_fdt(vms); =20 - possible_cpus =3D mc->possible_cpu_arch_ids(machine); assert(possible_cpus->len =3D=3D max_cpus); for (n =3D 0; n < possible_cpus->len; n++) { Object *cpuobj; @@ -2646,7 +2686,7 @@ static int virt_kvm_type(MachineState *ms, const char= *type_str) max_vm_pa_size =3D kvm_arm_get_max_vm_ipa_size(ms, &fixed_ipa); =20 /* we freeze the memory map to compute the highest gpa */ - virt_set_memmap(vms); + virt_set_memmap(vms, max_vm_pa_size); =20 requested_pa_size =3D 64 - clz64(vms->highest_gpa); =20 --=20 2.30.2 From nobody Thu Apr 25 08:31:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642169580353592.5124209532778; Fri, 14 Jan 2022 06:13:00 -0800 (PST) Received: from localhost ([::1]:53970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8NK7-00041i-BA for importer@patchew.org; Fri, 14 Jan 2022 09:12:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFZ-0006mx-ER for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:17 -0500 Received: from [2604:1380:4601:e00::1] (port=44134 helo=ams.source.kernel.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFX-0002q4-7Q for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D5CACB825F7; Fri, 14 Jan 2022 14:08:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BB2FC36AEA; Fri, 14 Jan 2022 14:08:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=hot-poop.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n8NFL-000V8K-KZ; Fri, 14 Jan 2022 14:08:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642169285; bh=+j7fPeRRv68KrVPtxSs60N+ZuvAsLE9Bw+2TU2jHgoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XvgKwbyKqtgukelVtUiizqfkGIiaERnOflKAXbG26u3EeRD42bMXvxuXVo/jJFlEb HHBmoF6ivfmMh+T2SuqWg9ysV1z+UiRhx3jxLpZhj/gSA1ULl8kpkht0h1Alde6+yx SbJI4dB2CKvDlrRuGlIo/MKWaqTUXaSOl6qwlF4tUa2hILhbhXIK23BkQYYkVZfQbX 4bXNtveTLzFztTgJPugFXP6R1n2mZP9ZY5TtvaKlL5TwyA61TiFt2mOxXY5qtszedZ 4hqd9QUJZebW1Q0SiuIs1rvTiuJG3uXcFTbp56Y0SDJqs9U6+CWo0mDuoAbz1r96gx tQdksv2LHEKZA== From: Marc Zyngier To: qemu-devel@nongnu.org Subject: [PATCH v5 5/6] hw/arm/virt: Disable highmem devices that don't fit in the PA range Date: Fri, 14 Jan 2022 14:07:40 +0000 Message-Id: <20220114140741.1358263-6-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220114140741.1358263-1-maz@kernel.org> References: <20220114140741.1358263-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qemu-devel@nongnu.org, drjones@redhat.com, eric.auger@redhat.com, peter.maydell@linaro.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Host-Lookup-Failed: Reverse DNS lookup failed for 2604:1380:4601:e00::1 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2604:1380:4601:e00::1; envelope-from=maz@kernel.org; helo=ams.source.kernel.org X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.595, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , kvm@vger.kernel.org, Eric Auger , kernel-team@android.com, kvmarm@lists.cs.columbia.edu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642169581542100001 Content-Type: text/plain; charset="utf-8" In order to only keep the highmem devices that actually fit in the PA range, check their location against the range and update highest_gpa if they fit. If they don't, mark them as disabled. Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger --- hw/arm/virt.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a427676b50..053791cc44 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1712,21 +1712,43 @@ static void virt_set_memmap(VirtMachineState *vms, = int pa_bits) base =3D vms->memmap[VIRT_MEM].base + LEGACY_RAMLIMIT_BYTES; } =20 + /* We know for sure that at least the memory fits in the PA space */ + vms->highest_gpa =3D memtop - 1; + for (i =3D VIRT_LOWMEMMAP_LAST; i < ARRAY_SIZE(extended_memmap); i++) { hwaddr size =3D extended_memmap[i].size; + bool fits; =20 base =3D ROUND_UP(base, size); vms->memmap[i].base =3D base; vms->memmap[i].size =3D size; + + /* + * Check each device to see if they fit in the PA space, + * moving highest_gpa as we go. + * + * For each device that doesn't fit, disable it. + */ + fits =3D (base + size) <=3D BIT_ULL(pa_bits); + if (fits) { + vms->highest_gpa =3D base + size - 1; + } + + switch (i) { + case VIRT_HIGH_GIC_REDIST2: + vms->highmem_redists &=3D fits; + break; + case VIRT_HIGH_PCIE_ECAM: + vms->highmem_ecam &=3D fits; + break; + case VIRT_HIGH_PCIE_MMIO: + vms->highmem_mmio &=3D fits; + break; + } + base +=3D size; } =20 - /* - * If base fits within pa_bits, all good. If it doesn't, limit it - * to the end of RAM, which is guaranteed to fit within pa_bits. - */ - vms->highest_gpa =3D (base <=3D BIT_ULL(pa_bits) ? base : memtop) - 1; - if (device_memory_size > 0) { ms->device_memory =3D g_malloc0(sizeof(*ms->device_memory)); ms->device_memory->base =3D device_memory_base; --=20 2.30.2 From nobody Thu Apr 25 08:31:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642170904216426.21597193920184; Fri, 14 Jan 2022 06:35:04 -0800 (PST) Received: from localhost ([::1]:42360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8NfS-0003q0-2f for importer@patchew.org; Fri, 14 Jan 2022 09:35:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFY-0006kW-Qf for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:16 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:48470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8NFX-0002qU-7U for qemu-devel@nongnu.org; Fri, 14 Jan 2022 09:08:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3735FB825FC; Fri, 14 Jan 2022 14:08:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C043DC36AE5; Fri, 14 Jan 2022 14:08:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=hot-poop.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n8NFL-000V8K-Qw; Fri, 14 Jan 2022 14:08:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642169285; bh=M8Cd2nEinA8ZwFjNff4KGOaxdFUznBmA2VZZ9jWgOeM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Euw0JHQJDj5DxbVGy/QeI27q2H1xV59vAQBaqTgglbXdGq7+0DDKME7He05ee4DkU wq3HRntqXZzFKYUn89Abo+Ep7tPAQwdQniUtGVKf1iNSOT50pwTQ+Z56mE9o+iXCXr NwChYObjEopccPjbNr0HapByMrVPptZazX6YMJcVziqowP5sb/gE1JhBLVHjPtyai2 dXTvehcWf//KTL2E5ZMKucG3Zmdk7s+QPmdBKt1NIoMUzkBrhC6EQLZe1VGCp+pYSC Xs6PQA/ohx8jrnNdsSpLQZDEuS4/3Wo+AmJw0BpIUw31bmWf/q7bA5bGPqCOHMhhMm b59Ctb9PGSbfA== From: Marc Zyngier To: qemu-devel@nongnu.org Subject: [PATCH v5 6/6] hw/arm/virt: Drop superfluous checks against highmem Date: Fri, 14 Jan 2022 14:07:41 +0000 Message-Id: <20220114140741.1358263-7-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220114140741.1358263-1-maz@kernel.org> References: <20220114140741.1358263-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qemu-devel@nongnu.org, drjones@redhat.com, eric.auger@redhat.com, peter.maydell@linaro.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=145.40.68.75; envelope-from=maz@kernel.org; helo=ams.source.kernel.org X-Spam_score_int: -76 X-Spam_score: -7.7 X-Spam_bar: ------- X-Spam_report: (-7.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.595, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , kvm@vger.kernel.org, Eric Auger , kernel-team@android.com, kvmarm@lists.cs.columbia.edu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642170905368100001 Content-Type: text/plain; charset="utf-8" Now that the devices present in the extended memory map are checked against the available PA space and disabled when they don't fit, there is no need to keep the same checks against highmem, as highmem really is a shortcut for the PA space being 32bit. Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier --- hw/arm/virt-acpi-build.c | 2 -- hw/arm/virt.c | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 0757c28f69..449fab0080 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -947,8 +947,6 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTa= bles *tables) acpi_add_table(table_offsets, tables_blob); build_fadt_rev5(tables_blob, tables->linker, vms, dsdt); =20 - vms->highmem_redists &=3D vms->highmem; - acpi_add_table(table_offsets, tables_blob); build_madt(tables_blob, tables->linker, vms); =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 053791cc44..4524f3807d 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2171,9 +2171,6 @@ static void machvirt_init(MachineState *machine) =20 virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem); =20 - vms->highmem_mmio &=3D vms->highmem; - vms->highmem_redists &=3D vms->highmem; - create_gic(vms, sysmem); =20 virt_cpu_post_init(vms, sysmem); @@ -2192,7 +2189,7 @@ static void machvirt_init(MachineState *machine) machine->ram_size, "mach-virt.tag"); } =20 - vms->highmem_ecam &=3D vms->highmem && (!firmware_loaded || aarch64); + vms->highmem_ecam &=3D (!firmware_loaded || aarch64); =20 create_rtc(vms); =20 --=20 2.30.2