linux-stable/drivers/iommu
Robin Murphy b0c1d88b83 iommu/iova: Improve 32-bit free space estimate
commit 5b61343b50 upstream.

For various reasons based on the allocator behaviour and typical
use-cases at the time, when the max32_alloc_size optimisation was
introduced it seemed reasonable to couple the reset of the tracked
size to the update of cached32_node upon freeing a relevant IOVA.
However, since subsequent optimisations focused on helping genuine
32-bit devices make best use of even more limited address spaces, it
is now a lot more likely for cached32_node to be anywhere in a "full"
32-bit address space, and as such more likely for space to become
available from IOVAs below that node being freed.

At this point, the short-cut in __cached_rbnode_delete_update() really
doesn't hold up any more, and we need to fix the logic to reliably
provide the expected behaviour. We still want cached32_node to only move
upwards, but we should reset the allocation size if *any* 32-bit space
has become available.

Reported-by: Yunfei Wang <yf.wang@mediatek.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/033815732d83ca73b13c11485ac39336f15c3b40.1646318408.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Cc: Miles Chen <miles.chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-08 13:57:13 +02:00
..
amd iommu/amd: Fix I/O page table memory leak 2022-02-14 12:52:40 +01:00
arm Rework of the MSI interrupt infrastructure: 2022-01-13 09:05:29 -08:00
intel iommu/vt-d: Fix double list_add when enabling VMD in scalable mode 2022-02-28 13:48:44 +01:00
apple-dart.c pci-v5.16-changes 2021-11-06 14:36:12 -07:00
dma-iommu.c iommu: Move flush queue data into iommu_dma_cookie 2021-12-20 09:03:05 +01:00
exynos-iommu.c iommu/exynos: Drop IOVA cookie management 2021-08-18 13:25:31 +02:00
fsl_pamu.c iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace 2021-04-07 10:56:52 +02:00
fsl_pamu.h iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace 2021-04-07 10:56:52 +02:00
fsl_pamu_domain.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
fsl_pamu_domain.h iommu/fsl_pamu: remove the snoop_id field 2021-04-07 10:56:52 +02:00
hyperv-iommu.c iommu/hyperv: setup an IO-APIC IRQ remapping domain for root partition 2021-02-11 08:47:07 +00:00
io-pgfault.c iommu: Add a page fault handler 2021-04-07 10:54:29 +02:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure 2021-12-14 14:45:35 +00:00
io-pgtable-arm.c iommu/io-pgtable-arm: Fix table descriptor paddr formatting 2021-12-06 13:03:01 +01:00
io-pgtable-arm.h
io-pgtable.c iommu/io-pgtable: Add DART pagetable format 2021-08-12 13:15:02 +02:00
ioasid.c iommu: Fix some W=1 warnings 2022-01-31 16:49:54 +01:00
iommu-debugfs.c
iommu-sva-lib.c iommu/sva: Add PASID helpers 2020-11-23 14:16:55 +00:00
iommu-sva-lib.h iommu: Add a page fault handler 2021-04-07 10:54:29 +02:00
iommu-sysfs.c
iommu-traces.c
iommu.c iommu: Fix some W=1 warnings 2022-01-31 16:49:54 +01:00
iova.c iommu/iova: Improve 32-bit free space estimate 2022-04-08 13:57:13 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Hook up r8a77980 DT matching code 2021-09-28 11:43:50 +02:00
irq_remapping.c x86: Kill all traces of irq_remapping_get_irq_domain() 2020-10-28 20:26:28 +01:00
irq_remapping.h x86: Kill all traces of irq_remapping_get_irq_domain() 2020-10-28 20:26:28 +01:00
Kconfig iommu/arm: fix ARM_SMMU_QCOM compilation 2021-10-13 21:28:44 +02:00
Makefile iommu/dart: Add DART iommu driver 2021-08-12 13:15:02 +02:00
msm_iommu.c iommu: Drop unnecessary of_iommu.h includes 2021-06-08 14:15:46 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Fix out-of-range warning with clang 2021-09-28 11:59:11 +02:00
mtk_iommu.h iommu/mediatek: Add mt8192 support 2021-02-01 11:31:19 +00:00
mtk_iommu_v1.c iommu/mtk: Drop IOVA cookie management 2021-08-18 13:25:32 +02:00
of_iommu.c iommu: Remove unused of_get_dma_window() 2021-06-08 14:15:46 +02:00
omap-iommu-debug.c
omap-iommu.c iommu: Fix some W=1 warnings 2022-01-31 16:49:54 +01:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu/rockchip: Fix PAGE_DESC_HI_MASKs for RK3568 2021-11-26 22:54:20 +01:00
s390-iommu.c s390/pci: use physical addresses in DMA tables 2021-12-06 14:42:26 +01:00
sprd-iommu.c iommu/sprd: Drop IOVA cookie management 2021-08-18 13:25:32 +02:00
sun50i-iommu.c iommu/sun50i: Drop IOVA cookie management 2021-08-18 13:25:32 +02:00
tegra-gart.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
tegra-smmu.c iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find 2022-02-28 14:01:57 +01:00
virtio-iommu.c virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00