[openeuler:OLK-6.6 2195/2195] drivers/vhost/vdpa.c:589:16: error: call to undeclared function 'iommufd_ctx_from_fd'; ISO C99 and later do not support implicit function declarations

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: c02455c4cce8052f74fc11c09e9073c01c7f33a4 commit: 6a58b8be556fb7de52ae0272a994a1c73fffc903 [2195/2195] vhost/vdpa: Add support to bind and attach iommufd config: x86_64-randconfig-2002-20250501 (https://download.01.org/0day-ci/archive/20250627/202506270113.hqxVfK1W-lkp@i...) compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250627/202506270113.hqxVfK1W-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202506270113.hqxVfK1W-lkp@intel.com/ Note: the openeuler/OLK-6.6 HEAD c02455c4cce8052f74fc11c09e9073c01c7f33a4 builds fine. It only hurts bisectability. All errors (new ones prefixed by >>):
drivers/vhost/vdpa.c:589:16: error: call to undeclared function 'iommufd_ctx_from_fd'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 589 | iommufd_ctx = iommufd_ctx_from_fd(bind.iommufd); | ^ drivers/vhost/vdpa.c:589:16: note: did you mean 'iommufd_ctx_from_file'? include/linux/iommufd.h:143:35: note: 'iommufd_ctx_from_file' declared here 143 | static inline struct iommufd_ctx *iommufd_ctx_from_file(struct file *file) | ^ drivers/vhost/vdpa.c:589:14: error: incompatible integer to pointer conversion assigning to 'struct iommufd_ctx *' from 'int' [-Wint-conversion] 589 | iommufd_ctx = iommufd_ctx_from_fd(bind.iommufd); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated.
vim +/iommufd_ctx_from_fd +589 drivers/vhost/vdpa.c 576 577 static long vhost_vdpa_bind_iommufd(struct vhost_vdpa *v, int __user *argp) 578 { 579 struct vhost_vdpa_bind_iommufd bind; 580 struct iommufd_ctx *iommufd_ctx; 581 struct iommufd_device *idev; 582 struct device *dma_dev = vdpa_get_dma_dev(v->vdpa); 583 struct iommu_group *iommu_group = iommu_group_get(dma_dev); 584 int ret = 0; 585 586 if (copy_from_user(&bind, argp, sizeof(bind))) 587 return -EFAULT; 588
589 iommufd_ctx = iommufd_ctx_from_fd(bind.iommufd); 590 if (IS_ERR(iommufd_ctx)) 591 return PTR_ERR(iommufd_ctx); 592 593 if (v->domain) { 594 iommu_detach_device(v->domain, dma_dev); 595 iommu_domain_free(v->domain); 596 v->domain = NULL; 597 } 598 599 /** 600 * Default iommu domain is created when vdpa device driver probes. 601 * Unuse default domain first to avoid failure when claiming dma owner. 602 */ 603 if (dma_dev->bus && dma_dev->bus->dma_cleanup) 604 dma_dev->bus->dma_cleanup(dma_dev); 605 ret = iommu_group_claim_dma_owner(iommu_group, iommufd_ctx); 606 if (ret) 607 goto dma_configure; 608 609 idev = iommufd_device_bind(iommufd_ctx, dma_dev, &bind.out_devid); 610 if (IS_ERR(idev)) { 611 ret = PTR_ERR(idev); 612 goto release_owner; 613 } 614 v->iommufd_dev = idev; 615 616 if (copy_to_user(argp, &bind, sizeof(bind))) { 617 ret = -EFAULT; 618 goto unbind; 619 } 620 621 goto out; 622 623 unbind: 624 iommufd_device_unbind(v->iommufd_dev); 625 v->iommufd_dev = NULL; 626 release_owner: 627 iommu_group_release_dma_owner(iommu_group); 628 dma_configure: 629 if (dma_dev->bus && dma_dev->bus->dma_configure) 630 dma_dev->bus->dma_configure(dma_dev); 631 out: 632 iommufd_ctx_put(iommufd_ctx); 633 return ret; 634 } 635
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot