linux/drivers/iommu
Nicolin Chen bd529dbb66 iommufd: Add a nested HW pagetable object
IOMMU_HWPT_ALLOC already supports iommu_domain allocation for usersapce.
But it can only allocate a hw_pagetable that associates to a given IOAS,
i.e. only a kernel-managed hw_pagetable of IOMMUFD_OBJ_HWPT_PAGING type.

IOMMU drivers can now support user-managed hw_pagetables, for two-stage
translation use cases that require user data input from the user space.

Add a new IOMMUFD_OBJ_HWPT_NESTED type with its abort/destroy(). Pair it
with a new iommufd_hwpt_nested structure and its to_hwpt_nested() helper.
Update the to_hwpt_paging() helper, so a NESTED-type hw_pagetable can be
handled in the callers, for example iommufd_hw_pagetable_enforce_rr().

Screen the inputs including the parent PAGING-type hw_pagetable that has
a need of a new nest_parent flag in the iommufd_hwpt_paging structure.

Extend the IOMMU_HWPT_ALLOC ioctl to accept an IOMMU driver specific data
input which is tagged by the enum iommu_hwpt_data_type. Also, update the
@pt_id to accept hwpt_id too besides an ioas_id. Then, use them to allocate
a hw_pagetable of IOMMUFD_OBJ_HWPT_NESTED type using the
iommufd_hw_pagetable_alloc_nested() allocator.

Link: https://lore.kernel.org/r/20231026043938.63898-8-yi.l.liu@intel.com
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Co-developed-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2023-10-26 11:15:57 -03:00
..
amd iommu: Pass in parent domain with user_data to domain_alloc_user op 2023-10-26 11:15:57 -03:00
arm IOMMU Updates for Linux v6.6 2023-09-01 16:54:25 -07:00
intel iommu: Pass in parent domain with user_data to domain_alloc_user op 2023-10-26 11:15:57 -03:00
iommufd iommufd: Add a nested HW pagetable object 2023-10-26 11:15:57 -03:00
apple-dart.c iommu/apple-dart: mark apple_dart_pm_ops static 2023-08-07 14:28:06 +02:00
dma-iommu.c iommu: Optimise PCI SAC address trick 2023-07-14 16:14:17 +02:00
dma-iommu.h iommu: Optimise PCI SAC address trick 2023-07-14 16:14:17 +02:00
exynos-iommu.c Merge branches 'iommu/fixes', 'arm/allwinner', 'arm/exynos', 'arm/mediatek', 'arm/omap', 'arm/renesas', 'arm/rockchip', 'arm/smmu', 'ppc/pamu', 'unisoc', 'x86/vt-d', 'x86/amd', 'core' and 'platform-remove_new' into next 2023-04-14 13:45:50 +02:00
fsl_pamu_domain.c iommu/fsl: Use driver_managed_dma to allow VFIO to work 2023-06-01 11:47:48 +02:00
fsl_pamu_domain.h iommu/fsl_pamu: remove the snoop_id field 2021-04-07 10:56:52 +02:00
fsl_pamu.c iommu/fsl: fix all kernel-doc warnings in fsl_pamu.c 2023-03-22 14:50:15 +01: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
hyperv-iommu.c x86/vector: Rename send_cleanup_vector() to vector_schedule_cleanup() 2023-08-06 14:15:09 +02:00
io-pgfault.c iommu: Rename iommu-sva-lib.{c,h} 2022-11-03 15:47:54 +01:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Remove map/unmap 2022-11-19 10:44:15 +01:00
io-pgtable-arm.c iommu/io-pgtable-arm: Remove map/unmap 2022-11-19 10:44:15 +01:00
io-pgtable-arm.h
io-pgtable-dart.c iommu/io-pgtable-dart: Add DART PTE support for t6000 2022-09-26 13:49:40 +02:00
io-pgtable.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
iommu-debugfs.c
iommu-priv.h iommu: Move dev_iommu_ops() to private header 2023-08-18 12:52:15 -03:00
iommu-sva.c iommu: Move global PASID allocation from SVA to core 2023-08-09 17:44:36 +02:00
iommu-sva.h iommu: Remove ioasid infrastructure 2023-03-31 10:03:31 +02:00
iommu-sysfs.c iommu: Do not export iommu_device_link/unlink() 2023-07-14 16:14:15 +02:00
iommu-traces.c iommu: Remove detach_dev callback 2023-01-13 16:39:18 +01:00
iommu.c IOMMU Updates for Linux v6.6 2023-09-01 16:54:25 -07:00
iova.c iommu/iova: Optimize iova_magazine_alloc() 2023-05-22 17:09:51 +02:00
ipmmu-vmsa.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/renesas', 'arm/rockchip', 'arm/smmu', 'unisoc', 'x86/vt-d', 'x86/amd' and 'core' into next 2023-08-21 14:18:43 +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 vfio: Move iova_bitmap into iommufd 2023-10-24 11:58:42 -03:00
Makefile iommu: Remove ioasid infrastructure 2023-03-31 10:03:31 +02:00
msm_iommu_hw-8xxx.h
msm_iommu.c iommu/msm: Convert to platform remove callback returning void 2023-03-31 10:01:57 +02:00
msm_iommu.h
mtk_iommu_v1.c iommu/mtk_iommu_v1: Convert to platform remove callback returning void 2023-03-31 10:01:58 +02:00
mtk_iommu.c iommu/mediatek: mt8188: Add iova_region_larb_msk 2023-08-07 14:15:54 +02:00
of_iommu.c iommu: Have __iommu_probe_device() check for already probed devices 2023-07-14 16:14:12 +02:00
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-09-07 10:42:28 +02:00
omap-iommu.c Merge branches 'iommu/fixes', 'arm/allwinner', 'arm/exynos', 'arm/mediatek', 'arm/omap', 'arm/renesas', 'arm/rockchip', 'arm/smmu', 'ppc/pamu', 'unisoc', 'x86/vt-d', 'x86/amd', 'core' and 'platform-remove_new' into next 2023-04-14 13:45:50 +02:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu: rockchip: Allocate tables from all available memory for IOMMU v2 2023-07-14 16:18:04 +02:00
s390-iommu.c iommufd for 6.3 2023-02-24 14:34:12 -08:00
sprd-iommu.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/renesas', 'arm/rockchip', 'arm/smmu', 'unisoc', 'x86/vt-d', 'x86/amd' and 'core' into next 2023-08-21 14:18:43 +02:00
sun50i-iommu.c iommu/sun50i: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:52 -07:00
tegra-gart.c iommu: Add set_platform_dma_ops callbacks 2023-01-13 16:39:16 +01:00
tegra-smmu.c iommu: Explicitly include correct DT includes 2023-08-21 14:17:59 +02:00
virtio-iommu.c iommu: Explicitly include correct DT includes 2023-08-21 14:17:59 +02:00