Commit 25efbb0
iommu/amd: Enable PCI features based on attached domain capability
Commit eda8c28 ("iommu/amd: Enable device ATS/PASID/PRI capabilities
independently") changed the way it enables device capability while
attaching devices. I missed to account the attached domain capability.
Meaning if domain is not capable of handling PASID/PRI (ex: paging
domain with v1 page table) then enabling device feature is not required.
This patch enables PASID/PRI only if domain is capable of handling SVA.
Also move pci feature enablement to do_attach() function so that we make
SVA capability in one place. Finally make PRI enable/disable functions as
static functions.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240418103400.6229-9-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>1 parent c9e8701 commit 25efbb0
2 files changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
410 | 413 | | |
411 | 414 | | |
412 | 415 | | |
| |||
423 | 426 | | |
424 | 427 | | |
425 | 428 | | |
426 | | - | |
| 429 | + | |
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
| |||
465 | 468 | | |
466 | 469 | | |
467 | 470 | | |
468 | | - | |
469 | | - | |
| 471 | + | |
470 | 472 | | |
471 | 473 | | |
472 | 474 | | |
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
476 | | - | |
| 478 | + | |
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
| |||
2035 | 2037 | | |
2036 | 2038 | | |
2037 | 2039 | | |
| 2040 | + | |
2038 | 2041 | | |
2039 | 2042 | | |
2040 | 2043 | | |
| |||
2049 | 2052 | | |
2050 | 2053 | | |
2051 | 2054 | | |
| 2055 | + | |
2052 | 2056 | | |
2053 | 2057 | | |
2054 | 2058 | | |
2055 | 2059 | | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
2056 | 2065 | | |
2057 | 2066 | | |
2058 | 2067 | | |
| |||
2107 | 2116 | | |
2108 | 2117 | | |
2109 | 2118 | | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
2113 | 2119 | | |
2114 | 2120 | | |
2115 | 2121 | | |
| |||
0 commit comments