aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorJason Gunthorpe <[email protected]>2024-02-22 10:07:41 -0400
committerJoerg Roedel <[email protected]>2024-02-23 16:45:05 +0100
commit65d4418c5002ec5b0e529455bf4152fd43459079 (patch)
tree5e9cdeb9b970da41c8901b8f4bd1320f10e7f0e9 /lib/test_fortify/write_overflow-strncpy-src.c
parent16b1b39126e5d5d49eedb2245f9e781b22bde926 (diff)
iommu/sva: Restore SVA handle sharing
Prior to commit 092edaddb660 ("iommu: Support mm PASID 1:n with sva domains") the code allowed a SVA handle to be bound multiple times to the same (mm, device) pair. This was alluded to in the kdoc comment, but we had understood this to be more a remark about allowing multiple devices, not a literal same-driver re-opening the same SVA. It turns out uacce and idxd were both relying on the core code to handle reference counting for same-device same-mm scenarios. As this looks hard to resolve in the drivers bring it back to the core code. The new design has changed the meaning of the domain->users refcount to refer to the number of devices that are sharing that domain for the same mm. This is part of the design to lift the SVA domain de-duplication out of the drivers. Return the old behavior by explicitly de-duplicating the struct iommu_sva handle. The same (mm, device) will return the same handle pointer and the core code will handle tracking this. The last unbind of the handle will destroy it. Fixes: 092edaddb660 ("iommu: Support mm PASID 1:n with sva domains") Reported-by: Zhangfei Gao <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Tested-by: Zhangfei Gao <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions