Skip to content

iommufd: Prepare for IOMMUFD_OBJ_HW_QUEUE

Nicolin Chen linux-arm-kernel linux-iommu linux-patches lkml 2 versions – Applied

Status from this message: Applied to iommfd for-next, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 37 repliesApplied
  2. v112 patches 33 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/14iommufd: Apply obvious cosmetic fixesdrivers/iommu/iommufd/device.c drivers/iommu/iommufd/hw_pagetable.c drivers/iommu/iommufd/io_pagetable.c +7 more+27 -381 reply
2/14iommufd: Drop unused ictx in struct iommufd_vdevicedrivers/iommu/iommufd/iommufd_private.h+0 -11 reply
3/14iommufd: Use enum iommu_viommu_type for type in struct iommufd_viommuinclude/linux/iommufd.h+1 -12 replies
4/14iommufd: Use enum iommu_veventq_type for type in struct iommufd_veventqdrivers/iommu/iommufd/iommufd_private.h+3 -22 replies
5/14iommufd: Return EOPNOTSUPP for failures due to driver bugsdrivers/iommu/iommufd/device.c drivers/iommu/iommufd/hw_pagetable.c+3 -34 replies
6/14iommu: Introduce get_viommu_size and viommu_init opsinclude/linux/iommu.h include/linux/iommufd.h+21 -04 replies
7/14iommufd/viommu: Support get_viommu_size and viommu_init opsdrivers/iommu/iommufd/viommu.c+39 -33 replies
8/14iommufd/selftest: Drop parent domain from mock_iommu_domain_nesteddrivers/iommu/iommufd/selftest.c+0 -32 replies
9/14iommufd/selftest: Replace mock_viommu_alloc with mock_viommu_initdrivers/iommu/iommufd/selftest.c+14 -151 reply
10/14iommu/arm-smmu-v3: Replace arm_vsmmu_alloc with arm_vsmmu_initdrivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h+32 -285 replies
11/14iommu: Deprecate viommu_alloc opdrivers/iommu/iommufd/viommu.c include/linux/iommu.h include/linux/iommufd.h+5 -443 replies
12/14iommufd: Move _iommufd_object_alloc out of driver.cdrivers/iommu/iommufd/driver.c drivers/iommu/iommufd/iommufd_private.h drivers/iommu/iommufd/main.c +1 more+36 -431 reply
13/14iommufd: Introduce iommufd_object_alloc_ucmd helperdrivers/iommu/iommufd/iommufd_private.h drivers/iommu/iommufd/main.c+51 -05 replies
14/14iommufd: Apply the new iommufd_object_alloc_ucmd helperdrivers/iommu/iommufd/eventq.c drivers/iommu/iommufd/viommu.c+10 -282 replies

Reviews trailers per patch

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

PatchKevin TianJason GunthorpeLu BaoluWill DeaconPranjal Shrivastava
1/14R-b R-b R-b
2/14R-b R-b R-b
3/14R-b R-b R-b R-b
4/14R-b R-b R-b R-b
5/14R-b R-b R-b R-b
6/14R-b R-b R-b R-b
7/14R-b R-b R-b
8/14R-b R-b
9/14R-b R-b
10/14R-b A-b R-b R-b
11/14R-b R-b R-b R-b
12/14R-b R-b R-b
13/14R-b R-b R-b A-b
14/14R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/14] iommufd: Prepare for IOMMUFD_OBJ_HW_QUEUE

The new HW Queue object will require more interactions with IOMMU drivers, with a few more for-driver APIs. This will complicate the driver-allocated structure design like the viommu_alloc op: since the core structure is not initialized during the driver allocation stage, a new for-driver API can't reference any member in the core vIOMMU structure.

[before]
core: viommu = ops->viommu_alloc();
driver: // my_viommu is successfully allocated
driver: my_viommu = iommufd_viommu_alloc(...);
driver: // This may crash if it reads viommu->ictx
driver: new = iommufd_new_viommu_helper(my_viommu->core ...);
core: viommu->ictx = ucmd->ictx;
core: ...

Make a preparatory series doing:
1 Replace viommu_alloc design with get_viommu_size + viommu_init 2 Add a new iommufd_object_alloc_ucmd
3 Cosmetic fixes and clean ups

[after 1]
core: viommu = ops->get_viommu_size();
driver: return VIOMMU_STRUCT_SIZE();
core: viommu->ictx = ucmd->ictx; // and others
core: rc = ops->viommu_init();
driver: // This is safe now as viommu->ictx is inited
driver: new = iommufd_new_viommu_helper(my_viommu->core ...);
core: ...

Some of the patches are included from:
[PATCH v5 00/29] iommufd: Add vIOMMU infrastructure (Part-4 HW QUEUE)
https://lore.kernel.org/all/[email protected]/

This is on Github:
https://github.com/nicolinc/iommufd/commits/iommufd_hw_queue-prep-v2

Changelog
v2
* Add Reviewed-by from Kevin and Jason
* Drop unused mock_nested->parent
* Revise commit messages and kdocs
* Add WARN_ON if new_obj is already set
* Re-organize the patches replacing viommu_alloc
* Use EOPNOTSUPP for failures due to driver bugs
* Return size_t for get_viommu_size op (0 means EOPNOTSUPP)
v1
https://lore.kernel.org/all/[email protected]/

Thanks
Nicolin

Nicolin Chen (14):
iommufd: Apply obvious cosmetic fixes
iommufd: Drop unused ictx in struct iommufd_vdevice
iommufd: Use enum iommu_viommu_type for type in struct iommufd_viommu
iommufd: Use enum iommu_veventq_type for type in struct
iommufd_veventq
iommufd: Return EOPNOTSUPP for failures due to driver bugs
iommu: Introduce get_viommu_size and viommu_init ops iommufd/viommu: Support get_viommu_size and viommu_init ops iommufd/selftest: Drop parent domain from mock_iommu_domain_nested iommufd/selftest: Replace mock_viommu_alloc with mock_viommu_init iommu/arm-smmu-v3: Replace arm_vsmmu_alloc with arm_vsmmu_init
iommu: Deprecate viommu_alloc op
iommufd: Move _iommufd_object_alloc out of driver.c
iommufd: Introduce iommufd_object_alloc_ucmd helper
iommufd: Apply the new iommufd_object_alloc_ucmd helper

 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   | 11 ++--
 drivers/iommu/iommufd/io_pagetable.h          |  2 +-
 drivers/iommu/iommufd/iommufd_private.h       | 42 ++++++++++---
 include/linux/iommu.h                         | 26 ++++----
 include/linux/iommufd.h                       | 39 +++---------
 .../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c     | 46 +++++++-------
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   |  3 +-
 drivers/iommu/iommufd/device.c                |  5 +-
 drivers/iommu/iommufd/driver.c                | 33 ----------
 drivers/iommu/iommufd/eventq.c                | 14 ++---
 drivers/iommu/iommufd/hw_pagetable.c          | 10 ++-
 drivers/iommu/iommufd/io_pagetable.c          |  3 +-
 drivers/iommu/iommufd/iova_bitmap.c           |  1 -
 drivers/iommu/iommufd/main.c                  | 63 +++++++++++++++++--
 drivers/iommu/iommufd/pages.c                 |  9 ++-
 drivers/iommu/iommufd/selftest.c              | 56 ++++++++---------
 drivers/iommu/iommufd/viommu.c                | 48 +++++++++-----
 17 files changed, 222 insertions(+), 189 deletions(-)
Signature · 1 line
2.43.0