linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] iommu: Reject drivers with broken_unmanaged_domain
@ 2023-01-27 20:04 Nicolin Chen
  2023-01-27 20:04 ` [PATCH 1/4] iommu: Add a broken_unmanaged_domain flag in iommu_ops Nicolin Chen
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Nicolin Chen @ 2023-01-27 20:04 UTC (permalink / raw)
  To: jgg, kevin.tian, robin.murphy, joro, will, agross, andersson,
	konrad.dybcio, yong.wu, matthias.bgg, thierry.reding,
	alex.williamson, cohuck
  Cc: kvm, iommu, linux-arm-msm, linux-kernel, jonathanh,
	linux-mediatek, linux-tegra, linux-arm-kernel

Hi all,

Both IOMMU_DOMAIN_UNMANAGED and IOMMU_DOMAIN_DMA require the support
of __IOMMU_DOMAIN_PAGING capability, i.e. iommu_map/unmap. However,
some older iommu drivers do not fully support that, and these drivers
also do not advertise support for dma-iommu.c via IOMMU_DOMAIN_DMA,
or use arm_iommu_create_mapping(), so largely their implementations
of IOMMU_DOMAIN_UNMANAGED are untested. This means that a user like
vfio/iommufd does not likely work with them.

Thus, mark all these drivers as having "broken" UNAMANGED domains and
add a new device_iommu_unmanaged_supported() API for vfio/iommufd and
dma-iommu to refuse to work with these drivers.

These are preparatory changes for a new IOMMU API that will be used by
iommufd. Having this flag allows us to prevent any use of the new API
in iommufd, to keep things clean.

You can also find this series on Github:
https://github.com/nicolinc/iommufd/commits/broken_unmanaged_domain

Thank you
Nicolin Chen

Nicolin Chen (4):
  iommu: Add a broken_unmanaged_domain flag in iommu_ops
  iommu/dma: Do not init domain if broken_unmanaged_domain
  iommufd: Do not allocate device object if broken_unmanaged_domain
  vfio: Do not allocate domain if broken_unmanaged_domain

 drivers/iommu/dma-iommu.c       |  3 +++
 drivers/iommu/fsl_pamu_domain.c |  1 +
 drivers/iommu/iommu.c           | 24 ++++++++++++++++++++++++
 drivers/iommu/iommufd/device.c  |  3 +++
 drivers/iommu/msm_iommu.c       |  1 +
 drivers/iommu/mtk_iommu_v1.c    |  1 +
 drivers/iommu/omap-iommu.c      |  1 +
 drivers/iommu/tegra-gart.c      |  1 +
 drivers/iommu/tegra-smmu.c      |  1 +
 drivers/vfio/vfio_iommu_type1.c |  5 ++++-
 include/linux/iommu.h           | 11 +++++++++++
 11 files changed, 51 insertions(+), 1 deletion(-)

-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-02-02  3:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-27 20:04 [PATCH 0/4] iommu: Reject drivers with broken_unmanaged_domain Nicolin Chen
2023-01-27 20:04 ` [PATCH 1/4] iommu: Add a broken_unmanaged_domain flag in iommu_ops Nicolin Chen
2023-01-27 21:58   ` Robin Murphy
2023-01-27 23:39     ` Nicolin Chen
2023-01-27 23:54     ` Jason Gunthorpe
2023-01-29  8:11       ` Tian, Kevin
2023-01-30 13:33         ` Jason Gunthorpe
2023-02-01  3:14           ` Tian, Kevin
2023-02-01 14:55             ` Jason Gunthorpe
2023-02-02  3:50               ` Tian, Kevin
2023-01-29  7:54   ` Tian, Kevin
2023-01-27 20:04 ` [PATCH 2/4] iommu/dma: Do not init domain if broken_unmanaged_domain Nicolin Chen
2023-01-27 21:59   ` Robin Murphy
2023-01-27 22:51     ` Nicolin Chen
2023-01-27 20:04 ` [PATCH 3/4] iommufd: Do not allocate device object " Nicolin Chen
2023-01-27 20:04 ` [PATCH 4/4] vfio: Do not allocate domain " Nicolin Chen
2023-01-29  7:46 ` [PATCH 0/4] iommu: Reject drivers with broken_unmanaged_domain Tian, Kevin

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).