diff mbox series

[v3,01/19] vfio/iova_bitmap: Export more API symbols

Message ID 20230923012511.10379-2-joao.m.martins@oracle.com (mailing list archive)
State New, archived
Headers show
Series IOMMUFD Dirty Tracking | expand

Commit Message

Joao Martins Sept. 23, 2023, 1:24 a.m. UTC
In preparation to move iova_bitmap into iommufd, export the rest of API
symbols that will be used in what could be used by modules, namely:

	iova_bitmap_alloc
	iova_bitmap_free
	iova_bitmap_for_each

Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
 drivers/vfio/iova_bitmap.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jason Gunthorpe Oct. 13, 2023, 3:43 p.m. UTC | #1
On Sat, Sep 23, 2023 at 02:24:53AM +0100, Joao Martins wrote:
> In preparation to move iova_bitmap into iommufd, export the rest of API
> symbols that will be used in what could be used by modules, namely:
> 
> 	iova_bitmap_alloc
> 	iova_bitmap_free
> 	iova_bitmap_for_each
> 
> Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
> ---
>  drivers/vfio/iova_bitmap.c | 3 +++
>  1 file changed, 3 insertions(+)

All iommufd symbols should be exported more like:

drivers/iommu/iommufd/device.c:EXPORT_SYMBOL_NS_GPL(iommufd_device_replace, IOMMUFD);

Including these. So please fix them all here too

Jason
Joao Martins Oct. 13, 2023, 3:57 p.m. UTC | #2
On 13/10/2023 16:43, Jason Gunthorpe wrote:
> On Sat, Sep 23, 2023 at 02:24:53AM +0100, Joao Martins wrote:
>> In preparation to move iova_bitmap into iommufd, export the rest of API
>> symbols that will be used in what could be used by modules, namely:
>>
>> 	iova_bitmap_alloc
>> 	iova_bitmap_free
>> 	iova_bitmap_for_each
>>
>> Suggested-by: Alex Williamson <alex.williamson@redhat.com>
>> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
>> ---
>>  drivers/vfio/iova_bitmap.c | 3 +++
>>  1 file changed, 3 insertions(+)
> 
> All iommufd symbols should be exported more like:
> 
> drivers/iommu/iommufd/device.c:EXPORT_SYMBOL_NS_GPL(iommufd_device_replace, IOMMUFD);
> 
> Including these. So please fix them all here too

OK, Provided your comment on the next patch to move this into IOMMUFD.

The IOMMU core didn't exported symbols that way, so I adhered to the style in-use.
Jason Gunthorpe Oct. 13, 2023, 4:03 p.m. UTC | #3
On Fri, Oct 13, 2023 at 04:57:53PM +0100, Joao Martins wrote:
> On 13/10/2023 16:43, Jason Gunthorpe wrote:
> > On Sat, Sep 23, 2023 at 02:24:53AM +0100, Joao Martins wrote:
> >> In preparation to move iova_bitmap into iommufd, export the rest of API
> >> symbols that will be used in what could be used by modules, namely:
> >>
> >> 	iova_bitmap_alloc
> >> 	iova_bitmap_free
> >> 	iova_bitmap_for_each
> >>
> >> Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> >> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
> >> ---
> >>  drivers/vfio/iova_bitmap.c | 3 +++
> >>  1 file changed, 3 insertions(+)
> > 
> > All iommufd symbols should be exported more like:
> > 
> > drivers/iommu/iommufd/device.c:EXPORT_SYMBOL_NS_GPL(iommufd_device_replace, IOMMUFD);
> > 
> > Including these. So please fix them all here too
> 
> OK, Provided your comment on the next patch to move this into IOMMUFD.
> 
> The IOMMU core didn't exported symbols that way, so I adhered to the style in-use.

Well, this commit message says "move iova_bitmap into iommufd" :)

Jason
Joao Martins Oct. 13, 2023, 4:22 p.m. UTC | #4
On 13/10/2023 17:03, Jason Gunthorpe wrote:
> On Fri, Oct 13, 2023 at 04:57:53PM +0100, Joao Martins wrote:
>> On 13/10/2023 16:43, Jason Gunthorpe wrote:
>>> On Sat, Sep 23, 2023 at 02:24:53AM +0100, Joao Martins wrote:
>>>> In preparation to move iova_bitmap into iommufd, export the rest of API
>>>> symbols that will be used in what could be used by modules, namely:
>>>>
>>>> 	iova_bitmap_alloc
>>>> 	iova_bitmap_free
>>>> 	iova_bitmap_for_each
>>>>
>>>> Suggested-by: Alex Williamson <alex.williamson@redhat.com>
>>>> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
>>>> ---
>>>>  drivers/vfio/iova_bitmap.c | 3 +++
>>>>  1 file changed, 3 insertions(+)
>>>
>>> All iommufd symbols should be exported more like:
>>>
>>> drivers/iommu/iommufd/device.c:EXPORT_SYMBOL_NS_GPL(iommufd_device_replace, IOMMUFD);
>>>
>>> Including these. So please fix them all here too
>>
>> OK, Provided your comment on the next patch to move this into IOMMUFD.
>>
>> The IOMMU core didn't exported symbols that way, so I adhered to the style in-use.
> 
> Well, this commit message says "move iova_bitmap into iommufd" :)

:( It should have said 'into iommu core' just like the next patch which says
"vfio: Move iova_bitmap into iommu core". let me fix that, but well no point now
if the idea is to actually move to iommufd
diff mbox series

Patch

diff --git a/drivers/vfio/iova_bitmap.c b/drivers/vfio/iova_bitmap.c
index 0848f920efb7..f54b56388e00 100644
--- a/drivers/vfio/iova_bitmap.c
+++ b/drivers/vfio/iova_bitmap.c
@@ -268,6 +268,7 @@  struct iova_bitmap *iova_bitmap_alloc(unsigned long iova, size_t length,
 	iova_bitmap_free(bitmap);
 	return ERR_PTR(rc);
 }
+EXPORT_SYMBOL_GPL(iova_bitmap_alloc);
 
 /**
  * iova_bitmap_free() - Frees an IOVA bitmap object
@@ -289,6 +290,7 @@  void iova_bitmap_free(struct iova_bitmap *bitmap)
 
 	kfree(bitmap);
 }
+EXPORT_SYMBOL_GPL(iova_bitmap_free);
 
 /*
  * Returns the remaining bitmap indexes from mapped_total_index to process for
@@ -387,6 +389,7 @@  int iova_bitmap_for_each(struct iova_bitmap *bitmap, void *opaque,
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(iova_bitmap_for_each);
 
 /**
  * iova_bitmap_set() - Records an IOVA range in bitmap