Skip to content

Introduce default domains for iommu groups

Joerg Roedel linux-iommu lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest22 patches 12 repliesIn review
  2. v1 RFC5 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22iommu: Remove function name from pr_fmt()drivers/iommu/iommu.c+1 -10 replies
2/22iommu: Add a few printk messages to group handling codedrivers/iommu/iommu.c+9 -00 replies
3/22iommu: Propagate error in add_iommu_groupdrivers/iommu/iommu.c+1 -34 replies
4/22iommu: Clean up after a failed bus initializationdrivers/iommu/iommu.c+26 -90 replies
5/22iommu: Call remove_device call-back after driver releasedrivers/iommu/iommu.c+1 -10 replies
6/22iommu: Allocate a default domain for iommu groupsdrivers/iommu/iommu.c+28 -42 replies
7/22iommu: Limit iommu_attach/detach_device to devices with their own groupdrivers/iommu/iommu.c+67 -40 replies
8/22iommu: Make sure a device is always attached to a domaindrivers/iommu/iommu.c+75 -81 reply
9/22iommu: Add iommu_get_domain_for_dev functiondrivers/iommu/iommu.c include/linux/iommu.h+24 -00 replies
10/22iommu: Introduce direct mapped region handlingdrivers/iommu/iommu.c include/linux/iommu.h+47 -03 replies
11/22iommu: Create direct mappings in default domainsdrivers/iommu/iommu.c+48 -00 replies
12/22iommu: Add function to query the default domain of a groupdrivers/iommu/iommu.c include/linux/iommu.h+6 -00 replies
13/22iommu: Introduce iommu_request_dm_for_dev()drivers/iommu/iommu.c include/linux/iommu.h+58 -00 replies
14/22iommu/amd: Implement dm_region call-backsdrivers/iommu/amd_iommu.c+37 -00 replies
15/22iommu/amd: Use default domain if available for DMA-APIdrivers/iommu/amd_iommu.c+7 -00 replies
16/22iommu/amd: Implement add_device and remove_devicedrivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_init.c+63 -1780 replies
17/22iommu/amd: Support IOMMU_DOMAIN_DMA type allocationdrivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_types.h+73 -2410 replies
18/22iommu/amd: Support IOMMU_DOMAIN_IDENTITY type allocationdrivers/iommu/amd_iommu.c+7 -00 replies
19/22iommu/amd: Put IOMMUv2 devices in a direct mapped domaindrivers/iommu/amd_iommu.c+14 -10 replies
20/22iommu/amd: Get rid of device_dma_ops_init()drivers/iommu/amd_iommu.c+1 -390 replies
21/22iommu/amd: Remove unused fields from struct dma_ops_domaindrivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_types.h+0 -90 replies
22/22iommu/amd: Propagate errors from amd_iommu_init_apidrivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_init.c drivers/iommu/amd_iommu_proto.h+6 -50 replies

Reviews trailers per patch

None of the 22 patches has a Reviewed-by or Acked-by.

PatchHeiko Stuebner
1/22
2/22
3/22T-b
4/22
5/22
6/22
7/22
8/22
9/22
10/22
11/22
12/22
13/22
14/22
15/22
16/22
17/22
18/22
19/22
20/22
21/22
22/22

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 00/22 v2] Introduce default domains for iommu groups

Hi,

here is the second version of my patch-set to introduce default domains into the iommu core. This time it has a lot more patches, mostly because I added a proof of concept implementation by converting the AMD IOMMU driver to make use of it.

Converting the first driver to the new concept triggered a lot of changes and extensions in the patch-set to fit all the needs of a more complex iommu driver. Converting other drivers might need further changes, but that is something for the future.

A major change is that now the default domain has to be allocated by the code that allocates the iommu group. For PCI devices this happens in the IOMMU core, but drivers allocating the group on their own can now implement a policy that fits their needs (e.g. not allocate one domain per group but let multiple groups share one domain).

The new core code is changed in a way to stay compatible with the old behavior. All IOMMU drivers that are not yet converted to default domains should behave as without this patch-set.

I tested the patches on AMD systems with IOMMUv1 and IOMMUv2, did boot-testing and also successfully tested device assignment. I did the same tests on an Intel VT-d machine to make sure the changes do not introduce regressions on unconverted drivers.

If you prefer a git branch for testing, please look here:

git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git iommu-default-domains

Any feedback and further testing welcome!

Thanks,

Joerg

Joerg Roedel (22):
iommu: Remove function name from pr_fmt()
iommu: Add a few printk messages to group handling code
iommu: Propagate error in add_iommu_group
iommu: Clean up after a failed bus initialization
iommu: Call remove_device call-back after driver release
iommu: Allocate a default domain for iommu groups
iommu: Limit iommu_attach/detach_device to devices with their own
group
iommu: Make sure a device is always attached to a domain
iommu: Add iommu_get_domain_for_dev function
iommu: Introduce direct mapped region handling
iommu: Create direct mappings in default domains
iommu: Add function to query the default domain of a group
iommu: Introduce iommu_request_dm_for_dev()
iommu/amd: Implement dm_region call-backs
iommu/amd: Use default domain if available for DMA-API iommu/amd: Implement add_device and remove_device iommu/amd: Support IOMMU_DOMAIN_DMA type allocation iommu/amd: Support IOMMU_DOMAIN_IDENTITY type allocation iommu/amd: Put IOMMUv2 devices in a direct mapped domain iommu/amd: Get rid of device_dma_ops_init()
iommu/amd: Remove unused fields from struct dma_ops_domain iommu/amd: Propagate errors from amd_iommu_init_api

 drivers/iommu/amd_iommu.c       | 568 ++++++++++++----------------------------
 drivers/iommu/amd_iommu_init.c  |  34 +--
 drivers/iommu/amd_iommu_proto.h |   2 +-
 drivers/iommu/amd_iommu_types.h |  11 -
 drivers/iommu/iommu.c           | 369 ++++++++++++++++++++++++--
 include/linux/iommu.h           |  44 ++++
 6 files changed, 562 insertions(+), 466 deletions(-)
Signature · 1 line
1.9.1