Commit 1342881
iommu/amd: Add domain_alloc_user based domain allocation
Add the domain_alloc_user op implementation. To that end, refactor
amd_iommu_domain_alloc() to receive a dev pointer and flags, while renaming
it too, such that it becomes a common function shared with
domain_alloc_user() implementation. The sole difference with
domain_alloc_user() is that we initialize also other fields that
iommu_domain_alloc() does. It lets it return the iommu domain correctly
initialized in one function.
This is in preparation to add dirty enforcement on AMD implementation of
domain_alloc_user.
Link: https://lore.kernel.org/r/20231024135109.73787-11-joao.m.martins@oracle.com
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>1 parent 6098481 commit 1342881
1 file changed
Lines changed: 41 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
2155 | 2156 | | |
2156 | 2157 | | |
2157 | 2158 | | |
2158 | | - | |
| 2159 | + | |
| 2160 | + | |
2159 | 2161 | | |
2160 | 2162 | | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
2161 | 2170 | | |
2162 | 2171 | | |
2163 | 2172 | | |
2164 | 2173 | | |
2165 | 2174 | | |
2166 | 2175 | | |
2167 | | - | |
| 2176 | + | |
2168 | 2177 | | |
2169 | 2178 | | |
2170 | 2179 | | |
2171 | | - | |
| 2180 | + | |
2172 | 2181 | | |
2173 | 2182 | | |
2174 | 2183 | | |
2175 | 2184 | | |
2176 | 2185 | | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
2177 | 2192 | | |
2178 | 2193 | | |
2179 | 2194 | | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2180 | 2217 | | |
2181 | 2218 | | |
2182 | 2219 | | |
| |||
2464 | 2501 | | |
2465 | 2502 | | |
2466 | 2503 | | |
| 2504 | + | |
2467 | 2505 | | |
2468 | 2506 | | |
2469 | 2507 | | |
| |||
0 commit comments