diff options
| author | Jason Gunthorpe <jgg@nvidia.com> | 2025-04-08 19:54:03 +0300 |
|---|---|---|
| committer | Joerg Roedel <jroedel@suse.de> | 2025-04-17 17:22:46 +0300 |
| commit | b3efacc451e19a85fb5acb56d95f40532c4e31d2 (patch) | |
| tree | 382127b1f82ffcaeb2042a617b9ec64dda0b4b29 /include/linux | |
| parent | 580ccca4ee53d7f2a2c90044220887daec0dcd9a (diff) | |
| download | linux-b3efacc451e19a85fb5acb56d95f40532c4e31d2.tar.xz | |
iommu/pages: Allow sub page sizes to be passed into the allocator
Generally drivers have a specific idea what their HW structure size should
be. In a lot of cases this is related to PAGE_SIZE, but not always. ARM64,
for example, allows a 4K IO page table size on a 64K CPU page table
system.
Currently we don't have any good support for sub page allocations, but
make the API accommodate this by accepting a sub page size from the caller
and rounding up internally.
This is done by moving away from order as the size input and using size:
size == 1 << (order + PAGE_SHIFT)
Following patches convert drivers away from using order and try to specify
allocation sizes independent of PAGE_SIZE.
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/15-v4-c8663abbb606+3f7-iommu_pages_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iommu.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 3fb62165db19..062818b51822 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -342,9 +342,9 @@ typedef unsigned int ioasid_t; #define IOMMU_DIRTY_NO_CLEAR (1 << 0) /* - * Pages allocated through iommu_alloc_pages_node() can be placed on this list - * using iommu_pages_list_add(). Note: ONLY pages from iommu_alloc_pages_node() - * can be used this way! + * Pages allocated through iommu_alloc_pages_node_sz() can be placed on this + * list using iommu_pages_list_add(). Note: ONLY pages from + * iommu_alloc_pages_node_sz() can be used this way! */ struct iommu_pages_list { struct list_head pages; |
