[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.2 11/60] pci-host: designware: Limit value range of iATU vie
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.2 11/60] pci-host: designware: Limit value range of iATU viewport register |
Date: |
Wed, 21 Feb 2024 11:19:59 +0300 |
From: Guenter Roeck <linux@roeck-us.net>
The latest version of qemu (v8.2.0-869-g7a1dc45af5) crashes when booting
the mcimx7d-sabre emulation with Linux v5.11 and later.
qemu-system-arm: ../system/memory.c:2750: memory_region_set_alias_offset:
Assertion `mr->alias' failed.
Problem is that the Designware PCIe emulation accepts the full value range
for the iATU Viewport Register. However, both hardware and emulation only
support four inbound and four outbound viewports.
The Linux kernel determines the number of supported viewports by writing
0xff into the viewport register and reading the value back. The expected
value when reading the register is the highest supported viewport index.
Match that code by masking the supported viewport value range when the
register is written. With this change, the Linux kernel reports
imx6q-pcie 33800000.pcie: iATU: unroll F, 4 ob, 4 ib, align 0K, limit 4G
as expected and supported.
Fixes: d64e5eabc4c7 ("pci: Add support for Designware IP block")
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Nikita Ostrenkov <n.ostrenkov@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Message-id: 20240129060055.2616989-1-linux@roeck-us.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 8a73152020337a7fbf34daf0a006d4d89ec1494e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index f477f97847..f016f02109 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -340,6 +340,8 @@ static void designware_pcie_root_config_write(PCIDevice *d,
uint32_t address,
break;
case DESIGNWARE_PCIE_ATU_VIEWPORT:
+ val &= DESIGNWARE_PCIE_ATU_REGION_INBOUND |
+ (DESIGNWARE_PCIE_NUM_VIEWPORTS - 1);
root->atu_viewport = val;
break;
--
2.39.2
- [Stable-8.2.2 v0 00/60] Patch Round-up for stable 8.2.2, freeze on 2024-03-02, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 01/60] migration: Plug memory leak on HMP migrate error path, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 02/60] migration: Fix use-after-free of migration state object, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 04/60] Make 'uri' optional for migrate QAPI, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 05/60] qemu-docs: Update options for graphical frontends, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 07/60] target/arm: fix exception syndrome for AArch32 bkpt insn, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 03/60] vfio/pci: Clear MSI-X IRQ index always, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 06/60] block/blkio: Make s->mem_region_alignment be 64 bits, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 09/60] qemu-options.hx: Improve -serial option documentation, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 08/60] system/vl.c: Fix handling of '-serial none -serial something', Michael Tokarev, 2024/02/21
- [Stable-8.2.2 11/60] pci-host: designware: Limit value range of iATU viewport register,
Michael Tokarev <=
- [Stable-8.2.2 12/60] tcg/loongarch64: Set vector registers call clobbered, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 13/60] linux-user/aarch64: Add padding before __kernel_rt_sigreturn, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 14/60] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 10/60] target/arm: Reinstate "vfp" property on AArch32 CPUs, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 16/60] iotests: give tempdir an identifying name, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 34/60] virtio-gpu: Correct virgl_renderer_resource_get_info() error check, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 38/60] hw/i386: Fix _STA return value for ACPI0017, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 39/60] tests/acpi: Update DSDT.cxl to reflect change _STA return value., Michael Tokarev, 2024/02/21
- [Stable-8.2.2 40/60] linux-user/aarch64: Choose SYNC as the preferred MTE mode, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 21/60] hw/riscv/virt-acpi-build.c: fix leak in build_rhct(), Michael Tokarev, 2024/02/21