Commit d51bf43
iommu/amd: serialize sequence allocation under concurrent TLB invalidations
commit 9e249c4 upstream.
With concurrent TLB invalidations, completion wait randomly gets timed out
because cmd_sem_val was incremented outside the IOMMU spinlock, allowing
CMD_COMPL_WAIT commands to be queued out of sequence and breaking the
ordering assumption in wait_on_sem().
Move the cmd_sem_val increment under iommu->lock so completion sequence
allocation is serialized with command queuing.
And remove the unnecessary return.
Fixes: d2a0cac ("iommu/amd: move wait_on_sem() out of spinlock")
Tested-by: Srikanth Aithal <sraithal@amd.com>
Reported-by: Srikanth Aithal <sraithal@amd.com>
Signed-off-by: Ankit Soni <Ankit.Soni@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
[Salvatore Bonaccorso: Backport to v6.12.y where f32fe7c
("iommu/amd: Add support to remap/unmap IOMMU buffers for kdump") is not
present]
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent c28c87d commit d51bf43
3 files changed
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
| 768 | + | |
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1805 | 1805 | | |
1806 | 1806 | | |
1807 | 1807 | | |
1808 | | - | |
| 1808 | + | |
1809 | 1809 | | |
1810 | 1810 | | |
1811 | 1811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1195 | 1195 | | |
1196 | 1196 | | |
1197 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1198 | 1204 | | |
1199 | 1205 | | |
1200 | 1206 | | |
| |||
1209 | 1215 | | |
1210 | 1216 | | |
1211 | 1217 | | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | 1218 | | |
1216 | 1219 | | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
1217 | 1223 | | |
1218 | 1224 | | |
1219 | 1225 | | |
| |||
2877 | 2883 | | |
2878 | 2884 | | |
2879 | 2885 | | |
2880 | | - | |
2881 | | - | |
2882 | 2886 | | |
2883 | 2887 | | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
2884 | 2891 | | |
2885 | 2892 | | |
2886 | 2893 | | |
| |||
2894 | 2901 | | |
2895 | 2902 | | |
2896 | 2903 | | |
2897 | | - | |
2898 | 2904 | | |
2899 | 2905 | | |
2900 | 2906 | | |
| |||
0 commit comments