iommufd: Make destroy_rwsem use a lock class per object type
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 17 Jul 2023 18:12:11 +0000 (15:12 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 26 Jul 2023 13:20:21 +0000 (10:20 -0300)
commit83f7bc6fdfd2fca11f35c061194d60f88acb3086
treef755bb24f7583042167de06ab6074708a032a1c1
parente88d4ec154a87884086d3e38f2dfc66aec11bf8c
iommufd: Make destroy_rwsem use a lock class per object type

The selftest invokes things like replace under the object lock of its
idev which protects the idev in a similar way to a real user.
Unfortunately this triggers lockdep. A lock class per type will solve the
problem.

Link: https://lore.kernel.org/r/15-v8-6659224517ea+532-iommufd_alloc_jgg@nvidia.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/iommufd_private.h
drivers/iommu/iommufd/main.c