Commit 4a552f7
iommu/amd: Put list_add/del(dev_data) back under the domain->lock
The list domain->dev_list is protected by the domain->lock spinlock.
Any iteration, addition or removal must be under the lock.
Move the list_del() up into the critical section. pdom_is_sva_capable(),
and destroy_gcr3_table() do not interact with the list element.
Wrap the list_add() in a lock, it would make more sense if this was under
the same critical section as adjusting the refcounts earlier, but that
requires more complications.
Fixes: d6b47de ("iommu/amd: Reduce domain lock scope in attach device path")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/1-v1-3b9edcf8067d+3975-amd_dev_list_locking_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>1 parent fac04ef commit 4a552f7
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2073 | 2073 | | |
2074 | 2074 | | |
2075 | 2075 | | |
| 2076 | + | |
2076 | 2077 | | |
2077 | 2078 | | |
2078 | 2079 | | |
| |||
2113 | 2114 | | |
2114 | 2115 | | |
2115 | 2116 | | |
| 2117 | + | |
2116 | 2118 | | |
| 2119 | + | |
2117 | 2120 | | |
2118 | 2121 | | |
2119 | 2122 | | |
| |||
2160 | 2163 | | |
2161 | 2164 | | |
2162 | 2165 | | |
| 2166 | + | |
2163 | 2167 | | |
2164 | 2168 | | |
2165 | 2169 | | |
| |||
2168 | 2172 | | |
2169 | 2173 | | |
2170 | 2174 | | |
2171 | | - | |
2172 | 2175 | | |
2173 | 2176 | | |
2174 | 2177 | | |
| |||
0 commit comments