iommu: Prepare to deliver page faults to user space
Status from this message: Applied, thanks Baolu.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 posting 2/210 patches 35 repliesIn review
- v7 posting 2/210 patches 18 repliesSuperseded
- v6 posting 2/210 patches 38 repliesSuperseded
Earlier versions · 17
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 posting 2/2 | 9 patches | 53 replies | Superseded | |
| v4 posting 2/2 | 9 patches | 18 replies | Superseded | |
| v13 Latest | 16 patches | 1 reply | Applied | |
| v12 | 16 patches | 7 replies | Superseded | |
| v11 | 16 patches | 10 replies | Superseded | |
| v3 posting 2/2 | 8 patches | 34 replies | Superseded | |
| v10 | 16 patches | 14 replies | Superseded | |
| v9 | 14 patches | 6 replies | Superseded | |
| v8 posting 1/2 | 12 patches | 12 replies | Superseded | |
| v7 posting 1/2 | 12 patches | 36 replies | Superseded | |
| v2 posting 2/2 | 6 patches | 39 replies | Superseded | |
| v6 posting 1/2 | 12 patches | 2 replies | Superseded | |
| v5 posting 1/2 | 12 patches | 12 replies | Superseded | |
| v4 posting 1/2 | 10 patches | 37 replies | Superseded | |
| v3 posting 1/2 | 11 patches | 8 replies | Superseded | |
| v2 posting 1/2 | 12 patches | 57 replies | Superseded | |
| v1 | 9 patches | 27 replies | Superseded |
Changes in v13 from the cover letter
- Refine the comments for iopf_queue_remove_device().
Patches in v13 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/16 | iommu: Move iommu fault data to linux/iommu.hMAINTAINERS include/ include/ | +151 | 0 replies | |
| 2/16 | iommu/arm-smmu-v3: Remove unrecoverable faults reportingdrivers/ | +13 | 0 replies | |
| 3/16 | iommu: Remove unrecoverable fault datainclude/ | +2 | 0 replies | |
| 4/16 | iommu: Cleanup iopf data structure definitionsdrivers/ drivers/ include/ | +11 | 0 replies | |
| 5/16 | iommu: Merge iopf_device_param into iommu_fault_paramdrivers/ drivers/ include/ | +72 | 0 replies | |
| 6/16 | iommu: Remove iommu_[un]register_device_fault_handler()drivers/ drivers/ drivers/ +3 more | +13 | 0 replies | |
| 7/16 | iommu: Merge iommu_fault_event and iopf_faultdrivers/ drivers/ drivers/ +3 more | +17 | 0 replies | |
| 8/16 | iommu: Prepare for separating SVA and IOPFdrivers/ include/ | +32 | 0 replies | |
| 9/16 | iommu: Make iommu_queue_iopf() more genericdrivers/ drivers/ drivers/ +1 more | +61 | 0 replies | |
| 10/16 | iommu: Separate SVA and IOPFdrivers/ drivers/ drivers/ +9 more | +277 | 0 replies | |
| 11/16 | iommu: Refine locking for per-device fault data managementdrivers/ | +30 | 0 replies | |
| 12/16 | iommu: Use refcount for fault data accessdrivers/ drivers/ include/ | +88 | 0 replies | |
| 13/16 | iommu: Improve iopf_queue_remove_device()drivers/ drivers/ include/ | +41 | 0 replies | |
| 14/16 | iommu: Track iopf group instead of last faultdrivers/ include/ | +86 | 0 replies | |
| 15/16 | iommu: Make iopf_group_response() return voiddrivers/ drivers/ drivers/ +2 more | +99 | 0 replies | |
| 16/16 | iommu: Make iommu_report_device_fault() return voiddrivers/ drivers/ drivers/ +1 more | +19 | 0 replies |
Reviews trailers per patch
All 16 patches have a Reviewed-by or Acked-by.
| Patch | Jason Gunthorpe | Kevin Tian | Yi Liu | Yan Zhao | Longfang Liu |
|---|---|---|---|---|---|
| 1/16 | R-b | R-b | R-b | T-b | T-b |
| 2/16 | R-b | R-b | T-b | ||
| 3/16 | R-b | R-b | T-b | T-b | |
| 4/16 | R-b | R-b | R-b | T-b | T-b |
| 5/16 | R-b | R-b | T-b | T-b | |
| 6/16 | R-b | R-b | T-b | T-b | |
| 7/16 | R-b | R-b | R-b | T-b | T-b |
| 8/16 | R-b | R-b | R-b | T-b | T-b |
| 9/16 | R-b | R-b | R-b | T-b | T-b |
| 10/16 | R-b | R-b | T-b | T-b | |
| 11/16 | R-b | R-b | T-b | T-b | |
| 12/16 | R-b | R-b | T-b | ||
| 13/16 | R-b | T-b | |||
| 14/16 | R-b | R-b | T-b | ||
| 15/16 | R-b | R-b | |||
| 16/16 | 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.
Cover letter [PATCH v13 00/16] iommu: Prepare to deliver page faults to user space
When a user-managed page table is attached to an IOMMU, it is necessary to deliver IO page faults to user space so that they can be handled appropriately. One use case for this is nested translation, which is currently being discussed in the mailing list.
I have posted a RFC series [1] that describes the implementation of delivering page faults to user space through IOMMUFD. This series has received several comments on the IOMMU refactoring, which I am trying to address in this series.
The major refactoring includes:
- [PATCH 01 ~ 04] Move include/uapi/linux/iommu.h to include/linux/iommu.h. Remove the unrecoverable fault data definition.
- [PATCH 05 ~ 06] Remove iommu_[un]register_device_fault_handler().
- [PATCH 07 ~ 10] Separate SVA and IOPF. Make IOPF a generic page fault handling framework.
- [PATCH 11 ~ 16] Improve iopf framework.
This is also available at github [2].
[1] https://lore.kernel.org/linux-iommu/[email protected]/
[2] https://github.com/LuBaolu/intel-iommu/commits/preparatory-io-pgfault-delivery-v13
Change log:
v13:
- Refine the comments for iopf_queue_remove_device().
v12: https://lore.kernel.org/linux-iommu/[email protected]/
- Add Jason and Kevin's Reviewed-by tags.
- Fix some minor comments.
- No code change.
v11: https://lore.kernel.org/linux-iommu/[email protected]/
- Cleanup IOMMU_PAGE_RESP_PASID_VALID flag bit.
- Cleanup code comments.
v10: https://lore.kernel.org/linux-iommu/[email protected]/
- Make iopf_group_response() return void, as nobody can do anything
with the failure.
- Make iommu_report_device_fault() automatically respond to
unhandleable faults and change its return type to void.
- PATCH 01 ~ 14 are in good shapes now.
v9: https://lore.kernel.org/linux-iommu/[email protected]/
- Protecting the assignment of dev->iommu->fault_param with RCU.
- Extending the fault parameter's lifetime to the entire path of iopf handling.
- Since iopf_queue_flush_dev() can only be called before iopf_queue_remove_device(), there's no need to hold a reference
count.
- Improve iopf_queue_remove_device() as per Jason's comments on the device removal sequence from the iopf queue. This will likely
require changes to the iommu drivers, which are supposed to be addressed in separate series.
- Track the iopf_group as a whole instead of the last fault within the group to simplify the fault report and response paths.
- PATCH 01 ~ 11 are in good shapes now.
v8: https://lore.kernel.org/linux-iommu/[email protected]/
- Drop PATCH 12/12 as it is no longer necessary to drain page requests page requests during PASID translation changes.
- Separate PATCH 11/12 into two distinct patches. The first patch
refines locking scheme for protecting per-device fault data, while
the second patch replaces mutex with RCU to enhance locking
efficiency.
- PATCH 01 ~ 10 are in good shapes now.
v7: https://lore.kernel.org/linux-iommu/[email protected]/
- Rebase to v6.7-rc1.
- Export iopf_group_response() for global use.
- Release lock when calling iopf handler.
- The whole series has been verified to work for SVA case on Intel platforms by Zhao Yan. Add her Tested-by to affected patches.
v6: https://lore.kernel.org/linux-iommu/[email protected]/
- [PATCH 09/12] Check IS_ERR() against the iommu domain. [Jingqi/Jason]
- [PATCH 12/12] Rename the comments and name of iopf_queue_flush_dev(), no functionality changes. [Kevin]
- All patches rebased on the latest iommu/core branch.
v5: https://lore.kernel.org/linux-iommu/[email protected]/
- Consolidate per-device fault data management. (New patch 11)
- Improve iopf_queue_flush_dev(). (New patch 12)
v4: https://lore.kernel.org/linux-iommu/[email protected]/
- Merge iommu_fault_event and iopf_fault. They are duplicate.
- Move iommu_report_device_fault() and iommu_page_response() to io-pgfault.c.
- Move iommu_sva_domain_alloc() to iommu-sva.c.
- Add group->domain and use it directly in sva fault handler.
- Misc code refactoring and refining.
v3: https://lore.kernel.org/linux-iommu/[email protected]/
- Convert the fault data structures from uAPI to kAPI.
- Merge iopf_device_param into iommu_fault_param.
- Add debugging on domain lifetime for iopf.
- Remove patch "iommu: Change the return value of dev_iommu_get()".
- Remove patch "iommu: Add helper to set iopf handler for domain".
- Misc code refactoring and refining.
v2: https://lore.kernel.org/linux-iommu/[email protected]/
- Remove unrecoverable fault data definition as suggested by Kevin.
- Drop the per-device fault cookie code considering that doesn't make
much sense for SVA.
- Make the IOMMU page fault handling framework generic. So that it can available for use cases other than SVA.
v1: https://lore.kernel.org/linux-iommu/[email protected]/
Lu Baolu (16):
iommu: Move iommu fault data to linux/iommu.h iommu/arm-smmu-v3: Remove unrecoverable faults reporting
iommu: Remove unrecoverable fault data
iommu: Cleanup iopf data structure definitions
iommu: Merge iopf_device_param into iommu_fault_param
iommu: Remove iommu_[un]register_device_fault_handler()
iommu: Merge iommu_fault_event and iopf_fault
iommu: Prepare for separating SVA and IOPF
iommu: Make iommu_queue_iopf() more generic
iommu: Separate SVA and IOPF
iommu: Refine locking for per-device fault data management
iommu: Use refcount for fault data access
iommu: Improve iopf_queue_remove_device()
iommu: Track iopf group instead of last fault
iommu: Make iopf_group_response() return void
iommu: Make iommu_report_device_fault() return void
include/linux/iommu.h | 262 +++++++--- drivers/iommu/intel/iommu.h | 4 +- drivers/iommu/iommu-sva.h | 71 --- include/uapi/linux/iommu.h | 161 ------ .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 14 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 103 ++-- drivers/iommu/intel/iommu.c | 28 +- drivers/iommu/intel/svm.c | 41 +- drivers/iommu/io-pgfault.c | 473 ++++++++++-------- drivers/iommu/iommu-sva.c | 71 ++- drivers/iommu/iommu.c | 233 --------- MAINTAINERS | 1 - drivers/iommu/Kconfig | 4 + drivers/iommu/Makefile | 3 +- drivers/iommu/intel/Kconfig | 1 + 15 files changed, 583 insertions(+), 887 deletions(-) delete mode 100644 drivers/iommu/iommu-sva.h delete mode 100644 include/uapi/linux/iommu.h
Signature · 1 line
2.34.1