Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH v3 00/12] iommu: Domain allocation enhancements
@ 2024-10-17 14:01 Vasant Hegde
  2024-10-17 14:01 ` [PATCH v3 01/12] iommu: Refactor __iommu_domain_alloc() Vasant Hegde
                   ` (13 more replies)
  0 siblings, 14 replies; 45+ messages in thread
From: Vasant Hegde @ 2024-10-17 14:01 UTC (permalink / raw)
  To: iommu, joro
  Cc: will, robin.murphy, suravee.suthikulpanit, jgg, yi.l.liu,
	baolu.lu, kevin.tian, jacob.pan, Vasant Hegde

This series adds iommu_paging_domain_alloc_flags() which takes flags to
pass additional details for domain allocation (like domain with PASID
support). Also adjusts core code to handler variuos domain allocations.

Also updates AMD IOMMU driver domain allocation code. With this by
default it will allocate domain with V2 page table for PASID capable
device and v1 page table for rest of the devices.


TODO:
@Jason, @Kevin, @Baolu,
  With this series if driver implements domain_alloc_user() then we assume
  IOMMU always supports PASID. If IOMMU doesn't support PASID (ex: AMD driver
  not supporting V2 page table) and device is PASID capable, then driver will
  return error. Device probe will fail.

  I think if driver return error, core layer should retry without
  IOMMU_HWPT_ALLOC_PASID flag. Other option is indivisual driver in error path
  of domain_alloc_user allocating non-PASID capable domain.

  I prefer first option. Just wanted to discuss before implementing. Any preferred
  option here? OR any other better way to solve this?


Note :
  vt-d specific changes is handled in separate series [1].

[1] https://lore.kernel.org/linux-iommu/20241011042722.73930-8-baolu.lu@linux.intel.com/

@Baolu,
  Do you want me to include above patch in this series so that it doesn't break intel driver?

Thanks everyone who reviewed previous version and provided valuable feedbacks.


This series is based on top of v6.12-rc3.

This is also available at github :
  https://github.com/AMDESE/linux-iommu/tree/iommu_paging_domain_v3


Changes from V2 -> v3:
  - Added Review-by tags
  - Fixed warnings reported by 0-DAY CI
  - Added patch to enhance arm_smmu_domain_alloc_user() to support IOMMU_HWPT_ALLOC_PASID flag
  - Added new patch to check GIOSUP/GTSUP
  - Added patch to move V2 page table check to early_amd_iommu_init()
  - Added patch to adjust blocked/identity domain allocation in core layer
  - Dropped "iommu/amd: Add iommu_ops->domain_alloc_paging support"

V2 : https://lore.kernel.org/linux-iommu/20240911101911.6269-1-vasant.hegde@amd.com/T/#t

Changes from v1 -> v2:
  - Rebased on top of iommu/next
  - Split patches into smaller patches
  - Added global static identity domain support

V1 : https://lore.kernel.org/linux-iommu/20240821133554.7405-1-vasant.hegde@amd.com/

RFC v2: https://lore.kernel.org/linux-iommu/fc8715e4-fb44-433b-a42a-7804118ebc57@amd.com/T/#t

RFC v1 : https://lore.kernel.org/linux-iommu/7e249bc6-c578-40f0-aca7-835149a0ad39@amd.com/


Jason Gunthorpe (5):
  iommu: Refactor __iommu_domain_alloc()
  iommu: Introduce iommu_paging_domain_alloc_flags()
  iommu: Add new flag to explictly request PASID capable domain
  iommu: Put domain allocation in __iommu_group_alloc_blocking_domain()
  iommu: Create __iommu_alloc_identity_domain()

Vasant Hegde (7):
  iommu/arm-smmu-v3: Enhance domain_alloc_user() to allocate PASID
    capable domain
  iommu/amd: Add helper function to check GIOSUP/GTSUP
  iommu/amd: Move V2 page table support check to early_amd_iommu_init()
  iommu/amd: Separate page table setup from domain allocation
  iommu/amd: Pass page table type as param to pdom_setup_pgtable()
  iommu/amd: Enhance amd_iommu_domain_alloc_user()
  iommu/amd: Implement global identity domain

 drivers/iommu/amd/amd_iommu.h               |   8 +-
 drivers/iommu/amd/init.c                    |  18 ++-
 drivers/iommu/amd/iommu.c                   | 125 +++++++++-----
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c |   3 +
 drivers/iommu/iommu.c                       | 171 +++++++++++++-------
 include/linux/iommu.h                       |  14 +-
 include/uapi/linux/iommufd.h                |   6 +
 7 files changed, 240 insertions(+), 105 deletions(-)

-- 
2.31.1


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

end of thread, other threads:[~2024-10-23  8:52 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-17 14:01 [PATCH v3 00/12] iommu: Domain allocation enhancements Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 01/12] iommu: Refactor __iommu_domain_alloc() Vasant Hegde
2024-10-21  7:29   ` Yi Liu
2024-10-21  9:10     ` Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 02/12] iommu: Introduce iommu_paging_domain_alloc_flags() Vasant Hegde
2024-10-18  3:29   ` Baolu Lu
2024-10-21  7:47   ` Yi Liu
2024-10-21  9:19     ` Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 03/12] iommu: Add new flag to explictly request PASID capable domain Vasant Hegde
2024-10-18  3:43   ` Baolu Lu
2024-10-18 12:43     ` Jason Gunthorpe
2024-10-21  5:02       ` Baolu Lu
2024-10-18 14:16   ` Jason Gunthorpe
2024-10-21 10:02     ` Vasant Hegde
2024-10-21  7:57   ` Yi Liu
2024-10-23  8:52     ` Vasant Hegde
2024-10-21  7:59   ` Yi Liu
2024-10-22  4:54     ` Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 04/12] iommu/arm-smmu-v3: Enhance domain_alloc_user() to allocate " Vasant Hegde
2024-10-18 14:23   ` Jason Gunthorpe
2024-10-21  8:57     ` Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 05/12] iommu/amd: Add helper function to check GIOSUP/GTSUP Vasant Hegde
2024-10-18 14:23   ` Jason Gunthorpe
2024-10-17 14:01 ` [PATCH v3 06/12] iommu/amd: Move V2 page table support check to early_amd_iommu_init() Vasant Hegde
2024-10-18 14:24   ` Jason Gunthorpe
2024-10-17 14:01 ` [PATCH v3 07/12] iommu/amd: Separate page table setup from domain allocation Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 08/12] iommu/amd: Pass page table type as param to pdom_setup_pgtable() Vasant Hegde
2024-10-18 14:25   ` Jason Gunthorpe
2024-10-17 14:01 ` [PATCH v3 09/12] iommu/amd: Enhance amd_iommu_domain_alloc_user() Vasant Hegde
2024-10-18 14:27   ` Jason Gunthorpe
2024-10-21  9:00     ` Vasant Hegde
2024-10-22  7:48   ` Tian, Kevin
2024-10-23  8:47     ` Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 10/12] iommu/amd: Implement global identity domain Vasant Hegde
2024-10-17 14:01 ` [PATCH v3 11/12] iommu: Put domain allocation in __iommu_group_alloc_blocking_domain() Vasant Hegde
2024-10-18  4:02   ` Baolu Lu
2024-10-17 14:01 ` [PATCH v3 12/12] iommu: Create __iommu_alloc_identity_domain() Vasant Hegde
2024-10-18  4:04   ` Baolu Lu
2024-10-18 14:32   ` Jason Gunthorpe
2024-10-21  6:38     ` Vasant Hegde
2024-10-18  3:10 ` [PATCH v3 00/12] iommu: Domain allocation enhancements Baolu Lu
2024-10-18 12:50 ` Jason Gunthorpe
2024-10-21  9:08   ` Vasant Hegde
2024-10-22  7:50     ` Tian, Kevin
2024-10-23  8:48       ` Vasant Hegde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox