]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommufd: Move iommufd_sw_msi and related functions to driver.c
authorNicolin Chen <nicolinc@nvidia.com>
Tue, 25 Mar 2025 04:05:16 +0000 (21:05 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 25 Mar 2025 13:18:19 +0000 (10:18 -0300)
commitec031e1b35ded5acfcef100d9ee7144bbfa4bc12
tree2bedeb744297804847b9105a3b576d8066ddf095
parent6aa63a4ec947f350d1a2f9f6aba8591a2455d192
iommufd: Move iommufd_sw_msi and related functions to driver.c

To provide the iommufd_sw_msi() to the iommu core that is under a different
Kconfig, move it and its related functions to driver.c. Then, stub it into
the iommu-priv header. The iommufd_sw_msi_install() continues to be used by
iommufd internal, so put it in the private header.

Note that iommufd_sw_msi() will be called in the iommu core, replacing the
sw_msi function pointer. Given that IOMMU_API is "bool" in Kconfig, change
IOMMUFD_DRIVER_CORE to "bool" as well.

Since this affects the module size, here is before-n-after size comparison:
[Before]
   text    data     bss     dec     hex filename
  18797     848      56   19701    4cf5 drivers/iommu/iommufd/device.o
    722      44       0     766     2fe drivers/iommu/iommufd/driver.o
[After]
   text    data     bss     dec     hex filename
  17735     808      56   18599    48a7 drivers/iommu/iommufd/device.o
   3020     180       0    3200     c80 drivers/iommu/iommufd/driver.o

Link: https://patch.msgid.link/r/374c159592dba7852bee20968f3f66fa0ee8ca93.1742871535.git.nicolinc@nvidia.com
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommu-priv.h
drivers/iommu/iommufd/Kconfig
drivers/iommu/iommufd/device.c
drivers/iommu/iommufd/driver.c
drivers/iommu/iommufd/iommufd_private.h