Commit fb3de9f
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]>1 parent 78d4f34 commit fb3de9f
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3368 | 3368 | | |
3369 | 3369 | | |
3370 | 3370 | | |
| 3371 | + | |
3371 | 3372 | | |
3372 | 3373 | | |
3373 | | - | |
3374 | | - | |
3375 | | - | |
3376 | 3374 | | |
3377 | 3375 | | |
3378 | 3376 | | |
3379 | | - | |
3380 | | - | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
3381 | 3384 | | |
3382 | 3385 | | |
3383 | 3386 | | |
| |||
0 commit comments