iommu/amd: Change rlookup, irq_lookup, and alias to use kvalloc()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Apr 2025 16:54:04 +0000 (13:54 -0300)
committerJoerg Roedel <jroedel@suse.de>
Thu, 17 Apr 2025 14:22:47 +0000 (16:22 +0200)
commite874c666b15bcb6280c4e747d8de3879bb728829
tree825c70d1c667034dd8e8572107df2f3e5e7e02e7
parentb3efacc451e19a85fb5acb56d95f40532c4e31d2
iommu/amd: Change rlookup, irq_lookup, and alias to use kvalloc()

This is just CPU memory used by the driver to track things, it doesn't
need to use iommu-pages. All of them are indexed by devid and devid is
bounded by pci_seg->last_bdf or we are already out of bounds on the page
allocation.

Switch them to use some version of kvmalloc_array() and drop the now
unused constants and remove the tbl_size() round up to PAGE_SIZE multiples
logic.

Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/16-v4-c8663abbb606+3f7-iommu_pages_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c