iommu/vt-d: Convert to use static identity domain
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest7 patches 10 repliesIn review
- v37 patches 17 repliesSuperseded
- v26 patches 15 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 5 patches | 3 replies | Superseded |
Changes in v4 from the cover letter
- Add a new patch to remove has_iotlb_device flag as suggested by Jason.
https://lore.kernel.org/linux-iommu/[email protected]/
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | iommu/vt-d: Require DMA domain if hardware not support passthroughdrivers/ | +10 | 1 reply | |
| 2/7 | iommu/vt-d: Remove identity mappings from si_domaindrivers/ | +4 | 1 reply | |
| 3/7 | iommu/vt-d: Always reserve a domain ID for identity setupdrivers/ | +3 | 1 reply | |
| 4/7 | iommu/vt-d: Remove has_iotlb_device flagdrivers/ drivers/ drivers/ | +1 | 1 reply | |
| 5/7 | iommu/vt-d: Factor out helpers from domain_context_mapping_one()drivers/ | +58 | 1 reply | |
| 6/7 | iommu/vt-d: Add support for static identity domaindrivers/ | +110 | 3 replies | |
| 7/7 | iommu/vt-d: Cleanup si_domaindrivers/ | +19 | 1 reply |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by.
| Patch | Jason Gunthorpe | Kevin Tian |
|---|---|---|
| 1/7 | R-b | R-b |
| 2/7 | R-b | R-b |
| 3/7 | R-b | R-b |
| 4/7 | R-b | |
| 5/7 | R-b | R-b |
| 6/7 | R-b | R-b |
| 7/7 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/7] iommu/vt-d: Convert to use static identity domain
Intel's IOMMU driver used a special domain called 1:1 mapping domain to support the domain of type IOMMU_DOMAIN_IDENTITY, which enables device drivers to directly utilize physical addresses for DMA access despite the presence of IOMMU units.
The implementation of the 1:1 mapping domain is influenced by hardware differences. While modern Intel VT-d implementations support hardware passthrough translation mode, earlier versions lacked this feature, which requires a more complex implementation approach.
The 1:1 mapping domain for earlier hardware was implemented by associating a DMA domain with an IOVA (IO Virtual Address) equivalent to the physical address. While, for most hardware supporting passthrough mode, simply setting the hardware's passthrough mode is sufficient. These two modes were merged together in si_domain, which is a special DMA domain sharing the domain ops of an ordinary DMA domain.
As the iommu core has evolved, it has introduced global static identity domain with "never fail" attach semantics. This means that the domain is always available and cannot fail to attach. The iommu driver now assigns this domain directly at iommu_ops->identity_domain instead of allocating it through the domain allocation interface.
This converts the Intel IOMMU driver to embrace the global static identity domain. For early legacy hardwares that don't support passthrough translation mode, ask the iommu core to use a DMA type of default domain. For modern hardwares that support passthrough translation mode, implement a static global identity domain.
The whole series is also available at
https://github.com/LuBaolu/intel-iommu/commits/vtd-static-identity-domain-v4
Change log:
v4:
- Add a new patch to remove has_iotlb_device flag as suggested by Jason.
https://lore.kernel.org/linux-iommu/[email protected]/
v3: https://lore.kernel.org/linux-iommu/[email protected]/
- Kevin worried that some graphic devices might still require identity domain. Forcing DMA domain for those drivers might break the existing functionality.
https://lore.kernel.org/linux-iommu/BN9PR11MB52761FF9AB496B422596DDDF8C8AA@BN9PR11MB5276.namprd11.prod.outlook.com/
After confirmed with the graphic community, we decouple "igfx_off" kernel command from graphic identity mapping with the following commits:
ba00196ca41c ("iommu/vt-d: Decouple igfx_off from graphic identity mapping") 4b8d18c0c986 ("iommu/vt-d: Remove INTEL_IOMMU_BROKEN_GFX_WA").
v2: https://lore.kernel.org/linux-iommu/[email protected]/
- Re-orgnize the patches by removing 1:1 mappings before implementing global static domain.
v1: https://lore.kernel.org/linux-iommu/[email protected]/
Lu Baolu (7):
iommu/vt-d: Require DMA domain if hardware not support passthrough iommu/vt-d: Remove identity mappings from si_domain iommu/vt-d: Always reserve a domain ID for identity setup iommu/vt-d: Remove has_iotlb_device flag
iommu/vt-d: Factor out helpers from domain_context_mapping_one() iommu/vt-d: Add support for static identity domain iommu/vt-d: Cleanup si_domain
drivers/iommu/intel/iommu.h | 2 - drivers/iommu/intel/iommu.c | 468 +++++++++++++++-------------------- drivers/iommu/intel/nested.c | 2 - 3 files changed, 201 insertions(+), 271 deletions(-)
Signature · 1 line
2.34.1