tree: https://github.com/jgunthorpe/linux vfio_iommufd head: f44b706a4413f17e50f20999964b38d11ef84d98 commit: 7bdc8312d65ca5d0f189c073ab1d5a48a2a7bfbc [1/20] iommufd: PFN handling for iopt_pages config: s390-allmodconfig compiler: s390-linux-gcc (GCC) 12.1.0 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 # https://github.com/jgunthorpe/linux/commit/7bdc8312d65ca5d0f189c073ab1d5a48a2a7bfbc git remote add jgunthorpe https://github.com/jgunthorpe/linux git fetch --no-tags jgunthorpe vfio_iommufd git checkout 7bdc8312d65ca5d0f189c073ab1d5a48a2a7bfbc # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/iommu/iommufd/pages.c:275:5: warning: no previous prototype for 'batch_iommu_map_small' [-Wmissing-prototypes] 275 | int batch_iommu_map_small(struct iommu_domain *domain, unsigned long iova, | ^~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:816:12: warning: 'pfn_reader_first' defined but not used [-Wunused-function] 816 | static int pfn_reader_first(struct pfn_reader *pfns, struct iopt_pages *pages, | ^~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:750:12: warning: 'pfn_reader_seek_hole' defined but not used [-Wunused-function] 750 | static int pfn_reader_seek_hole(struct pfn_reader *pfns, | ^~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:722:13: warning: 'pfn_reader_done' defined but not used [-Wunused-function] 722 | static bool pfn_reader_done(struct pfn_reader *pfns) | ^~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:553:12: warning: 'update_pinned' defined but not used [-Wunused-function] 553 | static int update_pinned(struct iopt_pages *pages) | ^~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:474:22: warning: 'batch_rw' defined but not used [-Wunused-function] 474 | static unsigned long batch_rw(struct pfn_batch *batch, void *data, | ^~~~~~~~ drivers/iommu/iommufd/pages.c:408:13: warning: 'batch_to_pages' defined but not used [-Wunused-function] 408 | static void batch_to_pages(struct pfn_batch *batch, struct page **pages) | ^~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:373:12: warning: 'batch_to_xarray' defined but not used [-Wunused-function] 373 | static int batch_to_xarray(struct pfn_batch *batch, struct xarray *xa, | ^~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:297:12: warning: 'batch_to_domain' defined but not used [-Wunused-function] 297 | static int batch_to_domain(struct pfn_batch *batch, struct iommu_domain *domain, | ^~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:203:13: warning: 'batch_init_backup' defined but not used [-Wunused-function] 203 | static void batch_init_backup(struct pfn_batch *batch, size_t max_pages, | ^~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:121:22: warning: 'iopt_area_index_to_iova_last' defined but not used [-Wunused-function] 121 | static unsigned long iopt_area_index_to_iova_last(struct iopt_area *area, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/batch_iommu_map_small +275 drivers/iommu/iommufd/pages.c 267 268 /* 269 * This is part of the VFIO compatability support for VFIO_TYPE1_IOMMU. That 270 * mode permits splitting a mapped area up, and then one of the splits is 271 * unmapped. Doing this normally would cause us to violate our invariant of 272 * pairing map/unmap. Thus, to support old VFIO compatability disable support 273 * for batching consecutive PFNs. 274 */ > 275 int batch_iommu_map_small(struct iommu_domain *domain, unsigned long iova, 276 phys_addr_t paddr, size_t size, int prot) 277 { 278 unsigned long start_iova = iova; 279 int rc; 280 281 while (size) { 282 rc = iommu_map(domain, iova, paddr, PAGE_SIZE, prot); 283 if (rc) 284 goto err_unmap; 285 iova += PAGE_SIZE; 286 paddr += PAGE_SIZE; 287 size -= PAGE_SIZE; 288 } 289 return 0; 290 291 err_unmap: 292 if (start_iova != iova) 293 iommu_unmap_nofail(domain, start_iova, iova - start_iova); 294 return rc; 295 } 296 -- 0-DAY CI Kernel Test Service https://01.org/lkp