Commit 92e2bd5
iommu/amd: Introduce iommu_dev_data.flags to track device capabilities
Currently we use struct iommu_dev_data.iommu_v2 to keep track of the device
ATS, PRI, and PASID capabilities. But these capabilities can be enabled
independently (except PRI requires ATS support). Hence, replace
the iommu_v2 variable with a flags variable, which keep track of the device
capabilities.
From commit 9bf49e3 ("PCI/ATS: Handle sharing of PF PRI Capability
with all VFs"), device PRI/PASID is shared between PF and any associated
VFs. Hence use pci_pri_supported() and pci_pasid_features() instead of
pci_find_ext_capability() to check device PRI/PASID support.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/20230921092147.5930-13-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>1 parent 739eb25 commit 92e2bd5
2 files changed
Lines changed: 30 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
| 814 | + | |
| 815 | + | |
815 | 816 | | |
816 | 817 | | |
817 | 818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 324 | + | |
| 325 | + | |
329 | 326 | | |
330 | | - | |
331 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
332 | 337 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
337 | 347 | | |
338 | 348 | | |
339 | | - | |
| 349 | + | |
340 | 350 | | |
341 | 351 | | |
342 | 352 | | |
| |||
396 | 406 | | |
397 | 407 | | |
398 | 408 | | |
399 | | - | |
400 | | - | |
| 409 | + | |
| 410 | + | |
401 | 411 | | |
402 | 412 | | |
403 | 413 | | |
| |||
1850 | 1860 | | |
1851 | 1861 | | |
1852 | 1862 | | |
1853 | | - | |
| 1863 | + | |
1854 | 1864 | | |
1855 | 1865 | | |
1856 | 1866 | | |
| |||
1916 | 1926 | | |
1917 | 1927 | | |
1918 | 1928 | | |
1919 | | - | |
| 1929 | + | |
1920 | 1930 | | |
1921 | 1931 | | |
1922 | 1932 | | |
| |||
2471 | 2481 | | |
2472 | 2482 | | |
2473 | 2483 | | |
2474 | | - | |
| 2484 | + | |
2475 | 2485 | | |
2476 | 2486 | | |
2477 | 2487 | | |
| |||
0 commit comments