Commit 3b122a5
iommu/amd: Sync once for scatter-gather operations
On virtual machines, software must flush the IOTLB after each page table
entry update.
The iommu_map_sg() code iterates through the given scatter-gather list
and invokes iommu_map() for each element in the scatter-gather list,
which calls into the vendor IOMMU driver through iommu_ops callback. As
the result, a single sg mapping may lead to multiple IOTLB flushes.
Fix this by adding amd_iotlb_sync_map() callback and flushing at this
point after all sg mappings we set.
This commit is followed and inspired by commit 933fcd0
("iommu/vt-d: Add iotlb_sync_map callback").
Cc: Joerg Roedel <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Jiajun Cao <[email protected]>
Cc: Robin Murphy <[email protected]>
Cc: Lu Baolu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Nadav Amit <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>1 parent fe6d269 commit 3b122a5
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2028 | 2028 | | |
2029 | 2029 | | |
2030 | 2030 | | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
2031 | 2041 | | |
2032 | 2042 | | |
2033 | 2043 | | |
| |||
2046 | 2056 | | |
2047 | 2057 | | |
2048 | 2058 | | |
2049 | | - | |
| 2059 | + | |
2050 | 2060 | | |
2051 | | - | |
2052 | | - | |
2053 | 2061 | | |
2054 | 2062 | | |
2055 | 2063 | | |
| |||
2229 | 2237 | | |
2230 | 2238 | | |
2231 | 2239 | | |
| 2240 | + | |
2232 | 2241 | | |
2233 | 2242 | | |
2234 | 2243 | | |
| |||
0 commit comments