Commit 8d00b77
iommu/amd: Move allocation of the top table into v1_alloc_pgtable
All the page table memory should be allocated/free within the io_pgtable
struct. The v2 path is already doing this, make it consistent.
It is hard to see but the free of the root in protection_domain_free() is
a NOP on the success path because v1_free_pgtable() does
amd_iommu_domain_clr_pt_root().
The root memory is already freed because free_sub_pt() put it on the
freelist. The free path in protection_domain_free() is only used during
error unwind of protection_domain_alloc().
Reviewed-by: Vasant Hegde <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>1 parent 89ffb2c commit 8d00b77
2 files changed
+8
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
579 | 580 | | |
580 | 581 | | |
581 | 582 | | |
582 | | - | |
583 | | - | |
584 | 583 | | |
585 | 584 | | |
586 | 585 | | |
587 | 586 | | |
588 | 587 | | |
589 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
590 | 594 | | |
591 | 595 | | |
592 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
| |||
2260 | 2258 | | |
2261 | 2259 | | |
2262 | 2260 | | |
2263 | | - | |
2264 | | - | |
2265 | | - | |
2266 | 2261 | | |
2267 | 2262 | | |
2268 | 2263 | | |
2269 | 2264 | | |
2270 | 2265 | | |
2271 | 2266 | | |
2272 | | - | |
| 2267 | + | |
2273 | 2268 | | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
2280 | | - | |
2281 | | - | |
2282 | | - | |
2283 | | - | |
2284 | 2269 | | |
2285 | | - | |
2286 | | - | |
2287 | 2270 | | |
2288 | 2271 | | |
2289 | 2272 | | |
| |||
2336 | 2319 | | |
2337 | 2320 | | |
2338 | 2321 | | |
2339 | | - | |
| 2322 | + | |
2340 | 2323 | | |
2341 | 2324 | | |
2342 | 2325 | | |
| |||
0 commit comments