tree: https://github.com/jgunthorpe/linux vfio_iommufd head: a97b7f88065ebfd42e065dd37f092fadf031b154 commit: ba8f921671cd4870b4cdbaf6d605faa57aee226d [23/24] vfio: Make vfio_container optionally compiled config: arm-buildonly-randconfig-r002-20220925 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/jgunthorpe/linux/commit/ba8f921671cd4870b4cdbaf6d605faa57aee226d git remote add jgunthorpe https://github.com/jgunthorpe/linux git fetch --no-tags jgunthorpe vfio_iommufd git checkout ba8f921671cd4870b4cdbaf6d605faa57aee226d # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/vfio/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from drivers/vfio/vfio_main.c:39: drivers/vfio/vfio.h:172:5: warning: no previous prototype for function 'vfio_container_pin_pages' [-Wmissing-prototypes] int vfio_container_pin_pages(struct vfio_container *container, ^ drivers/vfio/vfio.h:172:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int vfio_container_pin_pages(struct vfio_container *container, ^ static drivers/vfio/vfio.h:179:6: warning: no previous prototype for function 'vfio_container_unpin_pages' [-Wmissing-prototypes] void vfio_container_unpin_pages(struct vfio_container *container, ^ drivers/vfio/vfio.h:179:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void vfio_container_unpin_pages(struct vfio_container *container, ^ static drivers/vfio/vfio.h:184:5: warning: no previous prototype for function 'vfio_container_dma_rw' [-Wmissing-prototypes] int vfio_container_dma_rw(struct vfio_container *container, dma_addr_t iova, ^ drivers/vfio/vfio.h:184:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int vfio_container_dma_rw(struct vfio_container *container, dma_addr_t iova, ^ static >> drivers/vfio/vfio_main.c:680:3: error: call to undeclared function 'vfio_group_detach_container'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] vfio_group_detach_container(group); ^ >> drivers/vfio/vfio_main.c:767:9: error: call to undeclared function 'vfio_group_use_container'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ret = vfio_group_use_container(device->group); ^ drivers/vfio/vfio_main.c:767:9: note: did you mean 'vfio_group_ioctl_set_container'? drivers/vfio/vfio_main.c:692:12: note: 'vfio_group_ioctl_set_container' declared here static int vfio_group_ioctl_set_container(struct vfio_group *group, ^ >> drivers/vfio/vfio_main.c:783:3: error: call to undeclared function 'vfio_device_container_register'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] vfio_device_container_register(device); ^ >> drivers/vfio/vfio_main.c:789:3: error: call to undeclared function 'vfio_group_unuse_container'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] vfio_group_unuse_container(device->group); ^ drivers/vfio/vfio_main.c:789:3: note: did you mean 'vfio_group_ioctl_set_container'? drivers/vfio/vfio_main.c:692:12: note: 'vfio_group_ioctl_set_container' declared here static int vfio_group_ioctl_set_container(struct vfio_group *group, ^ >> drivers/vfio/vfio_main.c:804:3: error: call to undeclared function 'vfio_device_container_unregister'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] vfio_device_container_unregister(device); ^ drivers/vfio/vfio_main.c:809:3: error: call to undeclared function 'vfio_group_unuse_container'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] vfio_group_unuse_container(device->group); ^ drivers/vfio/vfio_main.c:1004:3: error: call to undeclared function 'vfio_group_detach_container'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] vfio_group_detach_container(group); ^ 3 warnings and 7 errors generated. -- In file included from drivers/vfio/vfio_iommu_type1.c:42: drivers/vfio/vfio.h:172:5: warning: no previous prototype for function 'vfio_container_pin_pages' [-Wmissing-prototypes] int vfio_container_pin_pages(struct vfio_container *container, ^ drivers/vfio/vfio.h:172:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int vfio_container_pin_pages(struct vfio_container *container, ^ static drivers/vfio/vfio.h:179:6: warning: no previous prototype for function 'vfio_container_unpin_pages' [-Wmissing-prototypes] void vfio_container_unpin_pages(struct vfio_container *container, ^ drivers/vfio/vfio.h:179:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void vfio_container_unpin_pages(struct vfio_container *container, ^ static drivers/vfio/vfio.h:184:5: warning: no previous prototype for function 'vfio_container_dma_rw' [-Wmissing-prototypes] int vfio_container_dma_rw(struct vfio_container *container, dma_addr_t iova, ^ drivers/vfio/vfio.h:184:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int vfio_container_dma_rw(struct vfio_container *container, dma_addr_t iova, ^ static drivers/vfio/vfio_iommu_type1.c:3168:14: warning: declaration of 'enum vfio_iommu_notify_type' will not be visible outside of this function [-Wvisibility] enum vfio_iommu_notify_type event) ^ >> drivers/vfio/vfio_iommu_type1.c:3168:37: error: variable has incomplete type 'enum vfio_iommu_notify_type' enum vfio_iommu_notify_type event) ^ drivers/vfio/vfio_iommu_type1.c:3168:14: note: forward declaration of 'enum vfio_iommu_notify_type' enum vfio_iommu_notify_type event) ^ >> drivers/vfio/vfio_iommu_type1.c:3172:15: error: use of undeclared identifier 'VFIO_IOMMU_CONTAINER_CLOSE' if (event != VFIO_IOMMU_CONTAINER_CLOSE) ^ >> drivers/vfio/vfio_iommu_type1.c:3180:43: error: variable has incomplete type 'const struct vfio_iommu_driver_ops' static const struct vfio_iommu_driver_ops vfio_iommu_driver_ops_type1 = { ^ drivers/vfio/vfio_iommu_type1.c:3180:21: note: forward declaration of 'struct vfio_iommu_driver_ops' static const struct vfio_iommu_driver_ops vfio_iommu_driver_ops_type1 = { ^ >> drivers/vfio/vfio_iommu_type1.c:3199:9: error: call to undeclared function 'vfio_register_iommu_driver'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] return vfio_register_iommu_driver(&vfio_iommu_driver_ops_type1); ^ >> drivers/vfio/vfio_iommu_type1.c:3204:2: error: call to undeclared function 'vfio_unregister_iommu_driver'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] vfio_unregister_iommu_driver(&vfio_iommu_driver_ops_type1); ^ drivers/vfio/vfio_iommu_type1.c:3204:2: note: did you mean 'vfio_unregister_group_dev'? include/linux/vfio.h:228:6: note: 'vfio_unregister_group_dev' declared here void vfio_unregister_group_dev(struct vfio_device *device); ^ 4 warnings and 5 errors generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for TEGRA20_APB_DMA Depends on [n]: DMADEVICES [=n] && (ARCH_TEGRA [=y] || COMPILE_TEST [=y]) Selected by [y]: - SOC_TEGRA_FUSE [=y] && ARCH_TEGRA [=y] && ARCH_TEGRA_2x_SOC [=y] WARNING: unmet direct dependencies detected for VFIO_IOMMU_TYPE1 Depends on [n]: VFIO [=y] && VFIO_CONTAINER [=n] Selected by [y]: - VFIO [=y] && (IOMMUFD [=y] || !IOMMUFD [=y]) && MMU [=y] && (X86 || S390 || ARM [=y] || ARM64) vim +3168 drivers/vfio/vfio_iommu_type1.c bdfae1c9a91393 Lu Baolu 2020-12-09 3166 487ace1340536e Steve Sistare 2021-01-29 3167 static void vfio_iommu_type1_notify(void *iommu_data, 487ace1340536e Steve Sistare 2021-01-29 @3168 enum vfio_iommu_notify_type event) 487ace1340536e Steve Sistare 2021-01-29 3169 { 487ace1340536e Steve Sistare 2021-01-29 3170 struct vfio_iommu *iommu = iommu_data; 487ace1340536e Steve Sistare 2021-01-29 3171 487ace1340536e Steve Sistare 2021-01-29 @3172 if (event != VFIO_IOMMU_CONTAINER_CLOSE) 487ace1340536e Steve Sistare 2021-01-29 3173 return; 487ace1340536e Steve Sistare 2021-01-29 3174 mutex_lock(&iommu->lock); 487ace1340536e Steve Sistare 2021-01-29 3175 iommu->container_open = false; 487ace1340536e Steve Sistare 2021-01-29 3176 mutex_unlock(&iommu->lock); 898b9eaeb3fe5e Steve Sistare 2021-01-29 3177 wake_up_all(&iommu->vaddr_wait); 487ace1340536e Steve Sistare 2021-01-29 3178 } 487ace1340536e Steve Sistare 2021-01-29 3179 73fa0d10d077d9 Alex Williamson 2012-07-31 @3180 static const struct vfio_iommu_driver_ops vfio_iommu_driver_ops_type1 = { 73fa0d10d077d9 Alex Williamson 2012-07-31 3181 .name = "vfio-iommu-type1", 73fa0d10d077d9 Alex Williamson 2012-07-31 3182 .owner = THIS_MODULE, 73fa0d10d077d9 Alex Williamson 2012-07-31 3183 .open = vfio_iommu_type1_open, 73fa0d10d077d9 Alex Williamson 2012-07-31 3184 .release = vfio_iommu_type1_release, 73fa0d10d077d9 Alex Williamson 2012-07-31 3185 .ioctl = vfio_iommu_type1_ioctl, 73fa0d10d077d9 Alex Williamson 2012-07-31 3186 .attach_group = vfio_iommu_type1_attach_group, 73fa0d10d077d9 Alex Williamson 2012-07-31 3187 .detach_group = vfio_iommu_type1_detach_group, a54eb55045ae9b Kirti Wankhede 2016-11-17 3188 .pin_pages = vfio_iommu_type1_pin_pages, a54eb55045ae9b Kirti Wankhede 2016-11-17 3189 .unpin_pages = vfio_iommu_type1_unpin_pages, 8cfc5b60751bcf Jason Gunthorpe 2022-07-19 3190 .register_device = vfio_iommu_type1_register_device, 8cfc5b60751bcf Jason Gunthorpe 2022-07-19 3191 .unregister_device = vfio_iommu_type1_unregister_device, 8d46c0cca5f4dc Yan Zhao 2020-03-24 3192 .dma_rw = vfio_iommu_type1_dma_rw, bdfae1c9a91393 Lu Baolu 2020-12-09 3193 .group_iommu_domain = vfio_iommu_type1_group_iommu_domain, 487ace1340536e Steve Sistare 2021-01-29 3194 .notify = vfio_iommu_type1_notify, 73fa0d10d077d9 Alex Williamson 2012-07-31 3195 }; 73fa0d10d077d9 Alex Williamson 2012-07-31 3196 73fa0d10d077d9 Alex Williamson 2012-07-31 3197 static int __init vfio_iommu_type1_init(void) 73fa0d10d077d9 Alex Williamson 2012-07-31 3198 { 73fa0d10d077d9 Alex Williamson 2012-07-31 @3199 return vfio_register_iommu_driver(&vfio_iommu_driver_ops_type1); 73fa0d10d077d9 Alex Williamson 2012-07-31 3200 } 73fa0d10d077d9 Alex Williamson 2012-07-31 3201 73fa0d10d077d9 Alex Williamson 2012-07-31 3202 static void __exit vfio_iommu_type1_cleanup(void) 73fa0d10d077d9 Alex Williamson 2012-07-31 3203 { 73fa0d10d077d9 Alex Williamson 2012-07-31 @3204 vfio_unregister_iommu_driver(&vfio_iommu_driver_ops_type1); 73fa0d10d077d9 Alex Williamson 2012-07-31 3205 } 73fa0d10d077d9 Alex Williamson 2012-07-31 3206 :::::: The code at line 3168 was first introduced by commit :::::: 487ace1340536ea9b8daf8c783a397a467fe55fc vfio/type1: implement notify callback :::::: TO: Steve Sistare :::::: CC: Alex Williamson -- 0-DAY CI Kernel Test Service https://01.org/lkp