anolis-cloud-kernel/drivers/iommu
Xu Yiwei f32648b9f7 anolis: sw64: iommu: do real map on iova in 32bit mmio space
ANBZ: #4688

According to commit bf4ff7699135 ("anolis: sw64: iommu: work around iova
range check after resv_region"), the current map/unmap strategy will
directly return success, without doing real map when application
trying to use IOVA in 3.5G~4G.

This solved the problem of passing IOVA check on initiating certain
application, but what we do not expect is that VFIO will still pin
the physical memory pages for these IOVA (in 3.5~4G). It seems to work
fine during normal using. But when it comes to unmap/unpin, as VFIO
cannot find the related physical pfns through mapping tables, (because
we did not actually map them!), it will cause a 512M physical memory
leak after application exits.

The current strategy is to do real mappings for these IOVA. As for
possible collisions, we rely on OS to not initiate access requests
in this range.

Fixes: bf4ff7699135 ("anolis: sw64: iommu: work around iova range check after
resv_region")

Signed-off-by: Xu Yiwei <xuyiwei@wxiat.com>
Reviewed-by: He Sheng <hesheng@wxiat.com>
Signed-off-by: Gu Zitao <guzitao@wxiat.com>
Reviewed-by: Min Li <gumi@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/5372
2025-06-05 06:59:14 +00:00
..
amd anolis: iommu/hygon: Add support for Hygon family 18h model 10h IOAPIC 2025-03-04 07:30:13 +00:00
arm iommu/arm-smmu-v3: Maintain a SID->device structure 2024-12-20 04:05:11 +00:00
intel iommu/vt-d: Set No Execute Enable bit in PASID table entry 2025-04-29 02:38:08 +00:00
sw64 anolis: sw64: iommu: do real map on iova in 32bit mmio space 2025-06-05 06:59:14 +00:00
Kconfig anolis: drivers/iommu: Add iommu support for loongarch 2024-01-18 10:29:56 +00:00
Makefile anolis: drivers/iommu: Add iommu support for loongarch 2024-01-18 10:29:56 +00:00
dma-iommu.c anolis: Fix dev->node equal to NUMA_NO_NODE issue 2024-05-28 09:54:05 +00:00
exynos-iommu.c
fsl_pamu.c
fsl_pamu.h
fsl_pamu_domain.c
fsl_pamu_domain.h
hyperv-iommu.c iommu/hyper-v: Disable IRQ pseudo-remapping if 15 bit APIC IDs are available 2022-08-01 12:07:46 +00:00
io-pgfault.c iommu: add domain argument to page response 2022-08-18 10:10:40 +08:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure 2022-01-27 10:53:43 +01:00
io-pgtable-arm.c iommu/arm-smmu-v3: Enable iotlb_sync_map according to SMMU_IIDR 2024-12-17 08:54:59 +00:00
io-pgtable-arm.h
io-pgtable.c iommu/amd: Prepare for generic IO page table framework 2024-04-23 09:17:51 +00:00
ioasid.c ioasid: Revert range adjustment 2022-08-12 17:25:03 +08:00
ioasid_user.c Add back quota to avoid no space issue when trying to open /dev/ioasid in the second time. 2022-08-02 16:47:11 +08:00
iommu-debugfs.c
iommu-sva-lib.c iommu/ioasid: Redefine IOASID set and allocation APIs 2022-08-02 16:28:22 +08:00
iommu-sva-lib.h iommu: Add a page fault handler 2022-08-02 16:42:29 +08:00
iommu-sysfs.c
iommu-traces.c
iommu.c treewide: Replace the use of mem_encrypt_active() with cc_platform_has() 2023-05-11 07:32:41 +00:00
iova.c iommu/iova: Manage the depot list size 2024-03-25 20:14:02 +08:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Check for error num after setting mask 2022-04-08 14:40:15 +02:00
irq_remapping.c x86: Kill all traces of irq_remapping_get_irq_domain() 2022-08-01 12:07:45 +00:00
irq_remapping.h x86: Kill all traces of irq_remapping_get_irq_domain() 2022-08-01 12:07:45 +00:00
loongarch_iommu.c anolis: drivers/iommu: Add iommu support for loongarch 2024-01-18 10:29:56 +00:00
loongarch_iommu.h anolis: drivers/iommu: Add iommu support for loongarch 2024-01-18 10:29:56 +00:00
msm_iommu.c iommu/msm: Fix an incorrect NULL check on list iterator 2022-06-09 10:21:26 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Add list_del in mtk_iommu_remove 2022-06-09 10:21:18 +02:00
mtk_iommu.h
mtk_iommu_v1.c
of_iommu.c
omap-iommu-debug.c
omap-iommu.c iommu/omap: Fix regression in probe for NULL pointer dereference 2022-04-13 21:01:07 +02:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c
s390-iommu.c
sun50i-iommu.c
tegra-gart.c iommu: Add iova and size as parameters in iotlb_sync_map 2022-08-02 16:42:14 +08:00
tegra-smmu.c
virtio-iommu.c iommu: Add capability IOMMU_CAP_VIOMMU_HINT 2022-08-02 16:27:47 +08:00