iommu/amd: Introduce per PCI segment last_bdf
authorVasant Hegde <vasant.hegde@amd.com>
Wed, 6 Jul 2022 11:38:00 +0000 (17:08 +0530)
committerJoerg Roedel <jroedel@suse.de>
Thu, 7 Jul 2022 07:37:39 +0000 (09:37 +0200)
commit307959008d80cdfd67fb19a146932582bb68a399
treeaea6b5ce0b58f9e9b61728c82a4c4494ef31a19b
parentb618ae6247bbafe0844355bafd948e59ebd77098
iommu/amd: Introduce per PCI segment last_bdf

Current code uses global "amd_iommu_last_bdf" to track the last bdf
supported by the system. This value is used for various memory
allocation, device data flushing, etc.

Introduce per PCI segment last_bdf which will be used to track last bdf
supported by the given PCI segment and use this value for all per
segment memory allocations. Eventually it will replace global
"amd_iommu_last_bdf".

Co-developed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20220706113825.25582-11-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c