iommu/amd: SVA Support (part 3) - refactor support for GCR3 table
Status from this message: Applied, thanks.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest17 patches 1 replyApplied
- v617 patches 9 repliesSuperseded
- v517 patches 13 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 16 patches | 25 replies | Superseded | |
| v3 | 13 patches | 28 replies | Superseded | |
| v2 | 10 patches | 15 replies | Superseded | |
| v1 | 11 patches | 23 replies | Superseded |
Changes in v7 from the cover letter
- Added Reviewed-by tags
- Rebased on top of iommu/next branch
- iommu: Introduce iommu_group_mutex_assert()
Removed 'extern' from iommu_group_mutex_assert() declaration
- iommu/amd: Refactor helper function for setting / clearing GCR3 Followed-success oriented flow
- Minor update to patch 11/17 description
Patches in v7 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | iommu/amd: Pass struct iommu_dev_data to set_dte_entry()drivers/ | +8 | 0 replies | |
| 2/17 | iommu/amd: Enable Guest Translation before registering devicesdrivers/ | +3 | 0 replies | |
| 3/17 | iommu/amd: Introduce get_amd_iommu_from_dev()drivers/ drivers/ include/ | +44 | 0 replies | |
| 4/17 | iommu/amd: Introduce struct protection_domain.pd_modedrivers/ drivers/ | +8 | 0 replies | |
| 5/17 | iommu/amd: Introduce per-device GCR3 tabledrivers/ | +7 | 0 replies | |
| 6/17 | iommu/amd: Use protection_domain.flags to check page table modedrivers/ | +2 | 0 replies | |
| 7/17 | iommu/amd: Add support for device based TLB invalidationdrivers/ drivers/ | +28 | 0 replies | |
| 8/17 | iommu/amd: Rearrange GCR3 table setup codedrivers/ | +32 | 0 replies | |
| 9/17 | iommu: Introduce iommu_group_mutex_assert()drivers/ include/ | +27 | 0 replies | |
| 10/17 | iommu/amd: Refactor helper function for setting / clearing GCR3drivers/ drivers/ drivers/ | +61 | 0 replies | |
| 11/17 | iommu/amd: Refactor attaching / detaching device functionsdrivers/ | +27 | 0 replies | |
| 12/17 | iommu/amd: Refactor protection_domain helper functionsdrivers/ | +3 | 0 replies | |
| 13/17 | iommu/amd: Refactor GCR3 table helper functionsdrivers/ | +31 | 0 replies | |
| 14/17 | iommu/amd: Remove unused flush pasid functionsdrivers/ drivers/ | +0 | 0 replies | |
| 15/17 | iommu/amd: Rearrange device flush codedrivers/ | +43 | 0 replies | |
| 16/17 | iommu/amd: Remove unused GCR3 table parameters from struct protection_domaindrivers/ drivers/ | +1 | 0 replies | |
| 17/17 | iommu/amd: Introduce per-device domain ID to fix potential TLB aliasing issuedrivers/ drivers/ | +64 | 0 replies |
Reviews trailers per patch
All 17 patches have a Reviewed-by or Acked-by.
| Patch | Jason Gunthorpe |
|---|---|
| 1/17 | R-b |
| 2/17 | R-b |
| 3/17 | R-b |
| 4/17 | R-b |
| 5/17 | R-b |
| 6/17 | R-b |
| 7/17 | R-b |
| 8/17 | R-b |
| 9/17 | R-b |
| 10/17 | R-b |
| 11/17 | R-b |
| 12/17 | R-b |
| 13/17 | R-b |
| 14/17 | R-b |
| 15/17 | R-b |
| 16/17 | R-b |
| 17/17 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v7 00/17] iommu/amd: SVA Support (part 3) - refactor support for GCR3 table
This is part 3 of the 4-part series to introduce Share Virtual Address (SVA) support, which focuses on refactoring GCR3 table. This moves GCR3 related information from protection domain structure to iommu_dev_data (per device) structure.
It contains the following enhancements:
* Patch 1 - 3:
Cleanup and introduce helper function
* Patch 4 - 13:
Introduce per device GCR3 table, invalidation based on per device and code refactoring. Also introduce iommu_group_mutex_assert.
* Patch 14 - 16:
Remove unused variable, rearrange functions to make it easy to maintain
* Patch 17:
Introduce per device domain ID.
This patch series is based on top of iommu/next branch (commit d2d00e15808).
This is also available at github :
https://github.com/AMDESE/linux/tree/iommu_sva_part3_v7_v6.8_rc2
Thanks Jason for reviewing previous versions and providing valuable feedbacks.
Changes from v6 -> v7:
- Added Reviewed-by tags
- Rebased on top of iommu/next branch
- iommu: Introduce iommu_group_mutex_assert()
Removed 'extern' from iommu_group_mutex_assert() declaration
- iommu/amd: Refactor helper function for setting / clearing GCR3 Followed-success oriented flow
- Minor update to patch 11/17 description
v6: https://lore.kernel.org/linux-iommu/[email protected]/T/#t
Changes from v5 -> v6:
- Moved per-device-domain-ID patch to end
- Added condition check for iommu_group_mutex_assert()
- Moving per-device-domain-id allocation/free to setup_gcr3_table()/free_gcr3_table
- Pass iommu to setup_gcr3_table instead of passing nid
v5: https://lore.kernel.org/linux-iommu/[email protected]/T/#t
Changes from v4 -> v5:
- Added get_amd_iommu_from_dev_data()
- pass gcr3_info instead of dev_data to setup/free_gcr3_table()
- Added path to EXPORT iommu_group_mutex_assert
- Moved dev_data->domid to gcr3_info->domid
v4: https://lore.kernel.org/linux-iommu/[email protected]/T/#t
Changes from v3 -> v4:
- Added new patch to enable IOMMU GT feature early
- Fixed dirty tracking path to use get_amd_iommu_from_dev()
- Fixed duplicate flush issue in do_attach() path
- Removed gcr3_info->giov variable. Instead we use domain page table mode to decide DTE[GIOV] bit.
- Free gcr3_table before calling set_dte_entry (otherwise there is a possibility of its setting up gcr3 table with glx 0)
- Adjusted gfp_t flag for GCR3 table allocation (GPF_ATOMIC -> GFP_KERNEL)
- Moved below patches from invalidation improvement series to this series
* Remove unused flush_pasid() related functions
(Originally it was part of Invalidation improvement series, I had to push it to
this series as set_gcr3() was still using __amd_iommu_flush_tlb()).
* Added patch to Rearrange device flush code
v3 : https://lore.kernel.org/linux-iommu/[email protected]/T/#t
Changes from v2 -> v3:
- Dropped "iommu/amd: Use struct protection_domain in helper functions" as flush related functions are already fixed and set_gcr3 related functions is reworked in this series.
- Removed moving to_pdomain() function from this series. It will be introduced in SVA series where it will be used.
- Added per device domain ID and per device invalidation functions
- Added functions to flush TLB for the given device
- Added Review-by tags
v2 : https://lore.kernel.org/linux-iommu/[email protected]/T/#t
Changes from v1 - v2:
- Dropped iommu_v2 module related support as newly introduced Part2 removed iommu_v2 module.
- Moved Patch 'Use struct protection_domain in helper functions' from Part1 to Part3
- Updated get_amd_iommu_from_dev() to retrieve iommu from device structure
- Removed 'PD_MODE_PT'
v1 : https://lore.kernel.org/linux-iommu/[email protected]/T/#t
Thank you,
Vasant / Suravee
Suravee Suthikulpanit (8):
iommu/amd: Introduce get_amd_iommu_from_dev()
iommu/amd: Introduce struct protection_domain.pd_mode iommu/amd: Introduce per-device GCR3 table
iommu/amd: Refactor helper function for setting / clearing GCR3 iommu/amd: Refactor attaching / detaching device functions iommu/amd: Refactor protection_domain helper functions iommu/amd: Refactor GCR3 table helper functions
iommu/amd: Remove unused GCR3 table parameters from struct protection_domain
Vasant Hegde (9):
iommu/amd: Pass struct iommu_dev_data to set_dte_entry() iommu/amd: Enable Guest Translation before registering devices iommu/amd: Use protection_domain.flags to check page table mode iommu/amd: Add support for device based TLB invalidation iommu/amd: Rearrange GCR3 table setup code
iommu: Introduce iommu_group_mutex_assert() iommu/amd: Remove unused flush pasid functions iommu/amd: Rearrange device flush code
iommu/amd: Introduce per-device domain ID to fix potential TLB
aliasing issue
drivers/iommu/amd/amd_iommu.h | 29 +- drivers/iommu/amd/amd_iommu_types.h | 26 +- drivers/iommu/amd/init.c | 6 +- drivers/iommu/amd/io_pgtable_v2.c | 21 +- drivers/iommu/amd/iommu.c | 627 +++++++++++++--------------- drivers/iommu/iommu.c | 19 + include/linux/iommu.h | 24 ++ 7 files changed, 376 insertions(+), 376 deletions(-)
Signature · 1 line
2.31.1