tree: https://github.com/jgunthorpe/linux vfio_iommufd head: c639c250f6f5b991f23efa0e76fe5ca689eae450 commit: 2aded62f4d737a93f83bcc0fbd979617ac39decd [8/26] iommufd: Algorithms for PFN storage 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/2aded62f4d737a93f83bcc0fbd979617ac39decd git remote add jgunthorpe https://github.com/jgunthorpe/linux git fetch --no-tags jgunthorpe vfio_iommufd git checkout 2aded62f4d737a93f83bcc0fbd979617ac39decd # 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 drivers/iommu/iommufd/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot Note: the jgunthorpe/vfio_iommufd HEAD c639c250f6f5b991f23efa0e76fe5ca689eae450 builds fine. It only hurts bisectability. All errors (new ones prefixed by >>): drivers/iommu/iommufd/pages.c: In function 'copy_data_page': drivers/iommu/iommufd/pages.c:438:21: error: 'IOMMUFD_ACCESS_RW_WRITE' undeclared (first use in this function) 438 | if (flags & IOMMUFD_ACCESS_RW_WRITE) { | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c:438:21: note: each undeclared identifier is reported only once for each function it appears in drivers/iommu/iommufd/pages.c: In function 'iopt_pages_rw_page': drivers/iommu/iommufd/pages.c:1307:25: error: 'IOMMUFD_ACCESS_RW_WRITE' undeclared (first use in this function) 1307 | flags & IOMMUFD_ACCESS_RW_WRITE ? FOLL_WRITE : 0, &page, NULL, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c: At top level: drivers/iommu/iommufd/pages.c:1335:5: warning: no previous prototype for 'iopt_pages_rw_access' [-Wmissing-prototypes] 1335 | int iopt_pages_rw_access(struct iopt_pages *pages, unsigned long start_byte, | ^~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c: In function 'iopt_pages_rw_access': drivers/iommu/iommufd/pages.c:1343:22: error: 'IOMMUFD_ACCESS_RW_WRITE' undeclared (first use in this function) 1343 | if ((flags & IOMMUFD_ACCESS_RW_WRITE) && !pages->writable) | ^~~~~~~~~~~~~~~~~~~~~~~ >> drivers/iommu/iommufd/pages.c:1346:23: error: 'IOMMUFD_ACCESS_RW_KTHREAD' undeclared (first use in this function) 1346 | if (!(flags & IOMMUFD_ACCESS_RW_KTHREAD) && change_mm) { | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c: At top level: drivers/iommu/iommufd/pages.c:1415:5: error: conflicting types for 'iopt_pages_add_access'; have 'int(struct iopt_pages *, long unsigned int, long unsigned int, struct page **, unsigned int)' 1415 | int iopt_pages_add_access(struct iopt_pages *pages, unsigned long start, | ^~~~~~~~~~~~~~~~~~~~~ In file included from drivers/iommu/iommufd/pages.c:52: drivers/iommu/iommufd/io_pagetable.h:159:5: note: previous declaration of 'iopt_pages_add_access' with type 'int(struct iopt_pages *, long unsigned int, long unsigned int, struct page **, bool)' {aka 'int(struct iopt_pages *, long unsigned int, long unsigned int, struct page **, _Bool)'} 159 | int iopt_pages_add_access(struct iopt_pages *pages, unsigned long start, | ^~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/pages.c: In function 'iopt_pages_add_access': drivers/iommu/iommufd/pages.c:1422:22: error: 'IOMMUFD_ACCESS_RW_WRITE' undeclared (first use in this function) 1422 | if ((flags & IOMMUFD_ACCESS_RW_WRITE) && !pages->writable) | ^~~~~~~~~~~~~~~~~~~~~~~ vim +/IOMMUFD_ACCESS_RW_KTHREAD +1346 drivers/iommu/iommufd/pages.c 1323 1324 /** 1325 * iopt_pages_rw_access - Copy to/from a linear slice of the pages 1326 * @pages: pages to act on 1327 * @start_byte: First byte of pages to copy to/from 1328 * @data: Kernel buffer to get/put the data 1329 * @length: Number of bytes to copy 1330 * @flags: IOMMUFD_ACCESS_RW_* flags 1331 * 1332 * This will find each page in the range, kmap it and then memcpy to/from 1333 * the given kernel buffer. 1334 */ 1335 int iopt_pages_rw_access(struct iopt_pages *pages, unsigned long start_byte, 1336 void *data, unsigned long length, unsigned int flags) 1337 { 1338 unsigned long start_index = start_byte / PAGE_SIZE; 1339 unsigned long last_index = (start_byte + length - 1) / PAGE_SIZE; 1340 bool change_mm = current->mm != pages->source_mm; 1341 int rc = 0; 1342 1343 if ((flags & IOMMUFD_ACCESS_RW_WRITE) && !pages->writable) 1344 return -EPERM; 1345 > 1346 if (!(flags & IOMMUFD_ACCESS_RW_KTHREAD) && change_mm) { 1347 if (start_index == last_index) 1348 return iopt_pages_rw_page(pages, start_index, 1349 start_byte % PAGE_SIZE, data, 1350 length, flags); 1351 mutex_lock(&pages->mutex); 1352 rc = iopt_pages_rw_slow(pages, start_index, last_index, 1353 start_byte % PAGE_SIZE, data, length, 1354 flags); 1355 mutex_unlock(&pages->mutex); 1356 return rc; 1357 } 1358 1359 /* 1360 * Try to copy using copy_to_user(). We do this as a fast path and 1361 * ignore any pinning decoherence, unlike a real DMA path. 1362 */ 1363 if (change_mm) { 1364 if (!mmget_not_zero(pages->source_mm)) 1365 return -EINVAL; 1366 kthread_use_mm(pages->source_mm); 1367 } 1368 1369 if (flags & IOMMUFD_ACCESS_RW_WRITE) { 1370 if (copy_to_user(pages->uptr + start_byte, data, length)) 1371 rc = -EFAULT; 1372 } else { 1373 if (copy_from_user(data, pages->uptr + start_byte, length)) 1374 rc = -EFAULT; 1375 } 1376 1377 if (change_mm) { 1378 kthread_unuse_mm(pages->source_mm); 1379 mmput(pages->source_mm); 1380 } 1381 1382 return rc; 1383 } 1384 -- 0-DAY CI Kernel Test Service https://01.org/lkp