From: Eric Auger <eric.auger@redhat.com>
To: Marc Zyngier <maz@kernel.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Andrew Jones <drjones@redhat.com>,
kernel-team@android.com, kvmarm@lists.cs.columbia.edu,
kvm@vger.kernel.org
Subject: Re: [PATCH v5 1/6] hw/arm/virt: Add a control for the the highmem PCIe MMIO
Date: Tue, 18 Jan 2022 14:52:47 +0100 [thread overview]
Message-ID: <a4a47554-64c9-75cf-fd99-6c69b4b76f6d@redhat.com> (raw)
In-Reply-To: <20220114140741.1358263-2-maz@kernel.org>
Hi Marc,
On 1/14/22 3:07 PM, Marc Zyngier wrote:
> 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 <maz@kernel.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> 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,
> }
>
> 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 = VIRT_ECAM_ID(highmem_ecam);
> + int ecam_id = VIRT_ECAM_ID(vms->highmem_ecam);
> struct GPEXConfig cfg = {
> .mmio32 = memmap[VIRT_PCIE_MMIO],
> .pio = memmap[VIRT_PCIE_PIO],
> @@ -170,7 +169,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
> .bus = vms->bus,
> };
>
> - if (use_highmem) {
> + if (vms->highmem_mmio) {
> cfg.mmio64 = memmap[VIRT_HIGH_PCIE_MMIO];
> }
>
> @@ -869,8 +868,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *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_TRANSPORTS);
> - 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);
>
> - if (vms->highmem) {
> + if (vms->highmem_mmio) {
> /* Map high MMIO space */
> MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1);
>
> @@ -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);
>
> - 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)
>
> virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem);
>
> + vms->highmem_mmio &= vms->highmem;
> +
> create_gic(vms, sysmem);
>
> virt_cpu_post_init(vms, sysmem);
> @@ -2802,6 +2804,7 @@ static void virt_instance_init(Object *obj)
> vms->gic_version = VIRT_GIC_VERSION_NOSEL;
>
> vms->highmem_ecam = !vmc->no_highmem_ecam;
> + vms->highmem_mmio = true;
>
> if (vmc->no_its) {
> vms->its = 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;
next prev parent reply other threads:[~2022-01-18 15:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-14 14:07 [PATCH v5 0/6] target/arm: Reduced-IPA space and highmem fixes Marc Zyngier
2022-01-14 14:07 ` [PATCH v5 1/6] hw/arm/virt: Add a control for the the highmem PCIe MMIO Marc Zyngier
2022-01-18 13:52 ` Eric Auger [this message]
2022-01-14 14:07 ` [PATCH v5 2/6] hw/arm/virt: Add a control for the the highmem redistributors Marc Zyngier
2022-01-18 13:51 ` Eric Auger
2022-01-14 14:07 ` [PATCH v5 3/6] hw/arm/virt: Honor highmem setting when computing the memory map Marc Zyngier
2022-01-14 14:07 ` [PATCH v5 4/6] hw/arm/virt: Use the PA range to compute " Marc Zyngier
2022-01-18 13:51 ` Eric Auger
2022-01-14 14:07 ` [PATCH v5 5/6] hw/arm/virt: Disable highmem devices that don't fit in the PA range Marc Zyngier
2022-01-18 13:51 ` Eric Auger
2022-01-14 14:07 ` [PATCH v5 6/6] hw/arm/virt: Drop superfluous checks against highmem Marc Zyngier
2022-01-18 17:17 ` [PATCH v5 0/6] target/arm: Reduced-IPA space and highmem fixes Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a4a47554-64c9-75cf-fd99-6c69b4b76f6d@redhat.com \
--to=eric.auger@redhat.com \
--cc=drjones@redhat.com \
--cc=kernel-team@android.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=maz@kernel.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).