diff mbox series

[rc,vfio] vfio/nvlink: Add missing SPAPR_TCE_IOMMU depends

Message ID 0-v1-83dba9768fc3+419-vfio_nvlink2_kconfig_jgg@nvidia.com (mailing list archive)
State New, archived
Headers show
Series [rc,vfio] vfio/nvlink: Add missing SPAPR_TCE_IOMMU depends | expand

Commit Message

Jason Gunthorpe March 29, 2021, 7 p.m. UTC
Compiling the nvlink stuff relies on the SPAPR_TCE_IOMMU otherwise there
are compile errors:

 drivers/vfio/pci/vfio_pci_nvlink2.c:101:10: error: implicit declaration of function 'mm_iommu_put' [-Werror,-Wimplicit-function-declaration]
                            ret = mm_iommu_put(data->mm, data->mem);

As PPC only defines these functions when the config is set.

Previously this wasn't a problem by chance as SPAPR_TCE_IOMMU was the only
IOMMU that could have satisfied IOMMU_API on POWERNV.

Fixes: 179209fa1270 ("vfio: IOMMU_API should be selected")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/vfio/pci/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Example .config builds OK after this.

Comments

Alex Williamson March 29, 2021, 8:50 p.m. UTC | #1
On Mon, 29 Mar 2021 16:00:16 -0300
Jason Gunthorpe <jgg@nvidia.com> wrote:

> Compiling the nvlink stuff relies on the SPAPR_TCE_IOMMU otherwise there
> are compile errors:
> 
>  drivers/vfio/pci/vfio_pci_nvlink2.c:101:10: error: implicit declaration of function 'mm_iommu_put' [-Werror,-Wimplicit-function-declaration]
>                             ret = mm_iommu_put(data->mm, data->mem);
> 
> As PPC only defines these functions when the config is set.
> 
> Previously this wasn't a problem by chance as SPAPR_TCE_IOMMU was the only
> IOMMU that could have satisfied IOMMU_API on POWERNV.
> 
> Fixes: 179209fa1270 ("vfio: IOMMU_API should be selected")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
>  drivers/vfio/pci/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Example .config builds OK after this.
> 
> diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
> index ac3c1dd3edeff1..4abddbebd4b236 100644
> --- a/drivers/vfio/pci/Kconfig
> +++ b/drivers/vfio/pci/Kconfig
> @@ -42,6 +42,6 @@ config VFIO_PCI_IGD
>  
>  config VFIO_PCI_NVLINK2
>  	def_bool y
> -	depends on VFIO_PCI && PPC_POWERNV
> +	depends on VFIO_PCI && PPC_POWERNV && SPAPR_TCE_IOMMU
>  	help
>  	  VFIO PCI support for P9 Witherspoon machine with NVIDIA V100 GPUs

Applied to vfio for-linus branch for v5.12.  Thanks,

Alex
diff mbox series

Patch

diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
index ac3c1dd3edeff1..4abddbebd4b236 100644
--- a/drivers/vfio/pci/Kconfig
+++ b/drivers/vfio/pci/Kconfig
@@ -42,6 +42,6 @@  config VFIO_PCI_IGD
 
 config VFIO_PCI_NVLINK2
 	def_bool y
-	depends on VFIO_PCI && PPC_POWERNV
+	depends on VFIO_PCI && PPC_POWERNV && SPAPR_TCE_IOMMU
 	help
 	  VFIO PCI support for P9 Witherspoon machine with NVIDIA V100 GPUs