diff mbox series

[for-next] RDMA/core: Fix ib_core building error when CONFIG_MMU=n

Message ID 20240808074026.3535706-1-huangjunxian6@hisilicon.com (mailing list archive)
State Rejected
Headers show
Series [for-next] RDMA/core: Fix ib_core building error when CONFIG_MMU=n | expand

Commit Message

Junxian Huang Aug. 8, 2024, 7:40 a.m. UTC
zap_vma_ptes() depends on CONFIG_MMU. When CONFIG_MMU=n,
a building error occurs due to the zap_vma_ptes() call in
uverbs_user_mmap_disassociate():

ERROR: modpost: "zap_vma_ptes" [drivers/infiniband/core/ib_core.ko] undefined!

Add "#ifdef CONFIG_MMU" to fix this error.

Fixes: 577b3696166a ("RDMA/core: Provide rdma_user_mmap_disassociate() to disassociate mmap pages")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408072142.mVX227UI-lkp@intel.com/
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
---
 drivers/infiniband/core/ib_core_uverbs.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Leon Romanovsky Aug. 8, 2024, 8:13 a.m. UTC | #1
On Thu, Aug 08, 2024 at 03:40:26PM +0800, Junxian Huang wrote:
> zap_vma_ptes() depends on CONFIG_MMU. When CONFIG_MMU=n,
> a building error occurs due to the zap_vma_ptes() call in
> uverbs_user_mmap_disassociate():
> 
> ERROR: modpost: "zap_vma_ptes" [drivers/infiniband/core/ib_core.ko] undefined!
> 
> Add "#ifdef CONFIG_MMU" to fix this error.

The fix is to return back include which was removed in 577b3696166a ("RDMA/core: Provide rdma_user_mmap_disassociate() to disassociate mmap pages").
I already did it as our wip/* branches are possible to rebase.

Thanks

> 
> Fixes: 577b3696166a ("RDMA/core: Provide rdma_user_mmap_disassociate() to disassociate mmap pages")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202408072142.mVX227UI-lkp@intel.com/
> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
> ---
>  drivers/infiniband/core/ib_core_uverbs.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/core/ib_core_uverbs.c b/drivers/infiniband/core/ib_core_uverbs.c
> index 4e27389a75ad..911aec0573cb 100644
> --- a/drivers/infiniband/core/ib_core_uverbs.c
> +++ b/drivers/infiniband/core/ib_core_uverbs.c
> @@ -367,6 +367,7 @@ int rdma_user_mmap_entry_insert(struct ib_ucontext *ucontext,
>  }
>  EXPORT_SYMBOL(rdma_user_mmap_entry_insert);
>  
> +#ifdef CONFIG_MMU
>  void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
>  {
>  	struct rdma_umap_priv *priv, *next_priv;
> @@ -428,7 +429,6 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
>  		mmput(mm);
>  	}
>  }
> -EXPORT_SYMBOL(uverbs_user_mmap_disassociate);
>  
>  /**
>   * rdma_user_mmap_disassociate() - disassociate the mmap from the ucontext.
> @@ -449,4 +449,14 @@ void rdma_user_mmap_disassociate(struct ib_ucontext *ucontext)
>  	uverbs_user_mmap_disassociate(ufile);
>  	up_read(&ufile->hw_destroy_rwsem);
>  }
> +#else
> +void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
> +{
> +}
> +
> +void rdma_user_mmap_disassociate(struct ib_ucontext *ucontext)
> +{
> +}
> +#endif
> +EXPORT_SYMBOL(uverbs_user_mmap_disassociate);
>  EXPORT_SYMBOL(rdma_user_mmap_disassociate);
> -- 
> 2.33.0
>
diff mbox series

Patch

diff --git a/drivers/infiniband/core/ib_core_uverbs.c b/drivers/infiniband/core/ib_core_uverbs.c
index 4e27389a75ad..911aec0573cb 100644
--- a/drivers/infiniband/core/ib_core_uverbs.c
+++ b/drivers/infiniband/core/ib_core_uverbs.c
@@ -367,6 +367,7 @@  int rdma_user_mmap_entry_insert(struct ib_ucontext *ucontext,
 }
 EXPORT_SYMBOL(rdma_user_mmap_entry_insert);
 
+#ifdef CONFIG_MMU
 void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
 {
 	struct rdma_umap_priv *priv, *next_priv;
@@ -428,7 +429,6 @@  void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
 		mmput(mm);
 	}
 }
-EXPORT_SYMBOL(uverbs_user_mmap_disassociate);
 
 /**
  * rdma_user_mmap_disassociate() - disassociate the mmap from the ucontext.
@@ -449,4 +449,14 @@  void rdma_user_mmap_disassociate(struct ib_ucontext *ucontext)
 	uverbs_user_mmap_disassociate(ufile);
 	up_read(&ufile->hw_destroy_rwsem);
 }
+#else
+void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
+{
+}
+
+void rdma_user_mmap_disassociate(struct ib_ucontext *ucontext)
+{
+}
+#endif
+EXPORT_SYMBOL(uverbs_user_mmap_disassociate);
 EXPORT_SYMBOL(rdma_user_mmap_disassociate);