[PATCH v3 09/23] iommu/pages: Formalize the freelist API

Baolu Lu baolu.lu at linux.intel.com
Tue Feb 25 22:56:29 PST 2025


On 2/26/25 03:39, Jason Gunthorpe wrote:
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index 38c65e92ecd091..e414951c0af83f 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -326,6 +326,18 @@ typedef unsigned int ioasid_t;
>   /* Read but do not clear any dirty bits */
>   #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!
> + */
> +struct iommu_pages_list {
> +	struct list_head pages;
> +};
> +
> +#define IOMMU_PAGES_LIST_INIT(name) \
> +	((struct iommu_pages_list){ .pages = LIST_HEAD_INIT(name.pages) })
> +
>   #ifdef CONFIG_IOMMU_API

Any reason why the above cannot be placed in the iommu-pages.h header
file? My understanding is that iommu-pages is only for the iommu drivers
and should not be accessible for external subsystems.

Thanks,
baolu



More information about the Linux-rockchip mailing list