Skip to content

iommu/vt-d: Add domain_alloc_paging support

Lu Baolu 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 Latest7 patches 4 repliesIn review
  2. v17 patches 16 repliesSuperseded

Changes in v2 from the cover letter

- Make prepare_domain_attach_device() a specific helper to check whether a paging domain is compatible with the iommu hardware capability.
- Rename prepare_domain_attach_device() to paging_domain_compatible() to make it more meaningful.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7iommu/vt-d: Add domain_alloc_paging supportdrivers/iommu/intel/iommu.c+14 -01 reply
2/7iommu/vt-d: Remove unused domain_alloc callbackdrivers/iommu/intel/iommu.c+0 -900 replies
3/7iommu/vt-d: Enhance compatibility check for paging domain attachdrivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h drivers/iommu/intel/nested.c +1 more+26 -772 replies
4/7iommu/vt-d: Remove domain_update_iommu_cap()drivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h+0 -840 replies
5/7iommu/vt-d: Remove domain_update_iommu_superpage()drivers/iommu/intel/iommu.c+1 -380 replies
6/7iommu/vt-d: Refactor first_level_by_default()drivers/iommu/intel/iommu.c+9 -80 replies
7/7iommu/vt-d: Refine intel_iommu_domain_alloc_user()drivers/iommu/intel/iommu.c+15 -20 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchJason Gunthorpe
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

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 v2 0/7] iommu/vt-d: Add domain_alloc_paging support

The Intel iommu driver will now use the domain_alloc_paging callback and remove the legacy domain_alloc callback. This ensures that a valid device pointer is provided whenever a paging domain is allocated, and all dmar_domain attributes can be set up at the time of allocation.

Both first-stage and second-stage page tables can be used for a paging domain. Unless IOMMU_HWPT_ALLOC_NEST_PARENT or IOMMU_HWPT_ALLOC_DIRTY_TRACKING is specified during paging domain allocation, this driver will try to use first-stage page tables if the hardware is capable. This is assuming that the first-stage page table is compatible with both the host and guest kernels.

The whole series is also available on GitHub:
https://github.com/LuBaolu/intel-iommu/commits/vtd-domain_alloc_paging-v2

Please help review and comment.

Change log:

v2:
- Make prepare_domain_attach_device() a specific helper to check whether a paging domain is compatible with the iommu hardware capability.
- Rename prepare_domain_attach_device() to paging_domain_compatible() to make it more meaningful.

v1: https://lore.kernel.org/linux-iommu/[email protected]/

Lu Baolu (7):
iommu/vt-d: Add domain_alloc_paging support iommu/vt-d: Remove unused domain_alloc callback iommu/vt-d: Enhance compatibility check for paging domain attach iommu/vt-d: Remove domain_update_iommu_cap() iommu/vt-d: Remove domain_update_iommu_superpage() iommu/vt-d: Refactor first_level_by_default() iommu/vt-d: Refine intel_iommu_domain_alloc_user()

 drivers/iommu/intel/iommu.h  |   4 +-
 drivers/iommu/intel/iommu.c  | 328 +++++++----------------------------
 drivers/iommu/intel/nested.c |   2 +-
 drivers/iommu/intel/pasid.c  |  28 +--
 4 files changed, 64 insertions(+), 298 deletions(-)
Signature · 1 line
2.43.0