iommu: Skip PASID validation for devices without PASID capability #237
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BugLink: https://bugs.launchpad.net/bugs/2119656
Generally PASID support requires ACS settings that usually create single device groups, but there are some niche cases where we can get multi-device groups and still have working PASID support. The primary issue is that PCI switches are not required to treat PASID tagged TLPs specially so appropriate ACS settings are required to route all TLPs to the host bridge if PASID is going to work properly.
pci_enable_pasid() does check that each device that will use PASID has the proper ACS settings to achieve this routing.
However, no-PASID devices can be combined with PASID capable devices within the same topology using non-uniform ACS settings. In this case the no-PASID devices may not have strict route to host ACS flags and end up being grouped with the PASID devices.
This configuration fails to allow use of the PASID within the iommu core code which wrongly checks if the no-PASID device supports PASID.
Fix this by ignoring no-PASID devices during the PASID validation. They will never issue a PASID TLP anyhow so they can be ignored.
Fixes: c404f55 ("iommu: Validate the PASID in iommu_attach_device_pasid()")
Cc: [email protected]
Reviewed-by: Lu Baolu [email protected]
Reviewed-by: Vasant Hegde [email protected]
Link: https://lore.kernel.org/r/[email protected]
(cherry picked from commit b3f6fcd)
Acked-by: Carol L Soto [email protected]
Acked-by: Matt Ochs [email protected]
Acked-by: Noah Wager [email protected]
Acked-by: Jacob Martin [email protected]