tree: https://github.com/sbates130272/linux-p2pmem.git p2pdma_user_cmb_v8 head: a2dd359c3f1baca6c0438adec8900b7fe57f92af commit: 34dbc33ec51c9e22ca9094054216d5e63d5cab08 [7/21] iommu: Explicitly skip bus address marked segments in __iommu_map_sg() config: riscv-randconfig-r042-20220706 compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 66ae1d60bb278793fd651cece264699d522bab84) 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 riscv cross compiling tool for clang build # apt-get install binutils-riscv-linux-gnu # https://github.com/sbates130272/linux-p2pmem/commit/34dbc33ec51c9e22ca9094054216d5e63d5cab08 git remote add sbates130272-p2pmem https://github.com/sbates130272/linux-p2pmem.git git fetch --no-tags sbates130272-p2pmem p2pdma_user_cmb_v8 git checkout 34dbc33ec51c9e22ca9094054216d5e63d5cab08 # 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=riscv SHELL=/bin/bash drivers/iommu/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All errors (new ones prefixed by >>): >> drivers/iommu/iommu.c:2460:7: error: call to undeclared function 'sg_is_dma_bus_address'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (sg_is_dma_bus_address(sg)) ^ 1 error generated. vim +/sg_is_dma_bus_address +2460 drivers/iommu/iommu.c 2435 2436 static ssize_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova, 2437 struct scatterlist *sg, unsigned int nents, int prot, 2438 gfp_t gfp) 2439 { 2440 const struct iommu_domain_ops *ops = domain->ops; 2441 size_t len = 0, mapped = 0; 2442 phys_addr_t start; 2443 unsigned int i = 0; 2444 int ret; 2445 2446 while (i <= nents) { 2447 phys_addr_t s_phys = sg_phys(sg); 2448 2449 if (len && s_phys != start + len) { 2450 ret = __iommu_map(domain, iova + mapped, start, 2451 len, prot, gfp); 2452 2453 if (ret) 2454 goto out_err; 2455 2456 mapped += len; 2457 len = 0; 2458 } 2459 > 2460 if (sg_is_dma_bus_address(sg)) 2461 goto next; 2462 2463 if (len) { 2464 len += sg->length; 2465 } else { 2466 len = sg->length; 2467 start = s_phys; 2468 } 2469 2470 next: 2471 if (++i < nents) 2472 sg = sg_next(sg); 2473 } 2474 2475 if (ops->iotlb_sync_map) 2476 ops->iotlb_sync_map(domain, iova, mapped); 2477 return mapped; 2478 2479 out_err: 2480 /* undo mappings already done */ 2481 iommu_unmap(domain, iova, mapped); 2482 2483 return ret; 2484 } 2485 -- 0-DAY CI Kernel Test Service https://01.org/lkp