diff options
| author | Yi Liu <[email protected]> | 2024-12-04 12:29:22 +0000 |
|---|---|---|
| committer | Joerg Roedel <[email protected]> | 2024-12-18 08:39:34 +0000 |
| commit | fb3de9f9b085d003a8a869ca6a4789d1bfbb3f22 (patch) | |
| tree | a14eb11497f42794b5750df29154be8fea68eac0 /net/switchdev/switchdev.c | |
| parent | Linux 6.13-rc3 (diff) | |
| download | kernel-fb3de9f9b085d003a8a869ca6a4789d1bfbb3f22.tar.gz kernel-fb3de9f9b085d003a8a869ca6a4789d1bfbb3f22.zip | |
iommu: Prevent pasid attach if no ops->remove_dev_pasid
driver should implement both set_dev_pasid and remove_dev_pasid op, otherwise
it is a problem how to detach pasid. In reality, it is impossible that an
iommu driver implements set_dev_pasid() but no remove_dev_pasid() op. However,
it is better to check it.
Move the group check to be the first as dev_iommu_ops() may fail when there
is no valid group. Also take the chance to remove the dev_has_iommu() check
as it is duplicated to the group check.
Reviewed-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Yi Liu <[email protected]>
Reviewed-by: Lu Baolu <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions
