[RFC PATCH v6 1/5] iommu: add an exported function to get minimum page size for a domain
Yoshihiro Shimoda
yoshihiro.shimoda.uh at renesas.com
Mon Jun 17 05:08:32 UTC 2019
Hi Wolfram-san,
> From: Wolfram Sang, Sent: Friday, June 14, 2019 4:38 AM
>
> On Thu, Jun 13, 2019 at 07:20:11PM +0900, Yoshihiro Shimoda wrote:
> > This patch adds an exported function to get minimum page size for
> > a domain. This patch also modifies similar codes on the iommu.c.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh at renesas.com>
> > ---
> > drivers/iommu/iommu.c | 18 +++++++++++++++---
> > include/linux/iommu.h | 1 +
> > 2 files changed, 16 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> > index 2a90638..7ed16af 100644
> > --- a/drivers/iommu/iommu.c
> > +++ b/drivers/iommu/iommu.c
> > @@ -280,6 +280,18 @@ iommu_insert_device_resv_regions(struct list_head *dev_resv_regions,
> > return ret;
> > }
> >
> > +/**
> > + * iommu_get_minimum_page_size - get minimum page size for a domain
> > + * @domain: the domain
> > + *
> > + * Allow iommu driver to get a minimum page size for a domain.
> > + */
> > +unsigned long iommu_get_minimum_page_size(struct iommu_domain *domain)
> > +{
> > + return 1UL << __ffs(domain->pgsize_bitmap);
> > +}
> > +EXPORT_SYMBOL_GPL(iommu_get_minimum_page_size);
>
> What about making this a 'static inline' in the iommu header file? I'd
> think it is simple enough and would save us the EXPORT symbol.
Thank you for the review. I think so. I'll use 'static inline' instead of
EXPORT symbol.
Best regards,
Yoshihiro Shimoda
More information about the iommu
mailing list