Hi Kirti, I love your patch! Perhaps something to improve: [auto build test WARNING on vfio/next] [also build test WARNING on v5.7-rc7 next-20200526] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Kirti-Wankhede/Add-UAPIs-to-support-migration-for-VFIO-devices/20200521-060843 base: https://github.com/awilliam/linux-vfio.git next config: x86_64-randconfig-s021-20200527 (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.1-240-gf0fe1cd9-dirty # save the attached .config to linux build tree make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) drivers/vfio/vfio_iommu_type1.c:981:48: sparse: sparse: cast removes address space '' of expression >> drivers/vfio/vfio_iommu_type1.c:981:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] *from @@ got unsigned long long [usertype] * @@ drivers/vfio/vfio_iommu_type1.c:981:61: sparse: expected void const [noderef] *from drivers/vfio/vfio_iommu_type1.c:981:61: sparse: got unsigned long long [usertype] * drivers/vfio/vfio_iommu_type1.c:988:27: sparse: sparse: cast removes address space '' of expression >> drivers/vfio/vfio_iommu_type1.c:988:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] *to @@ got unsigned long long [usertype] * @@ drivers/vfio/vfio_iommu_type1.c:988:40: sparse: expected void [noderef] *to drivers/vfio/vfio_iommu_type1.c:988:40: sparse: got unsigned long long [usertype] * vim +981 drivers/vfio/vfio_iommu_type1.c 962 963 static int update_user_bitmap(u64 __user *bitmap, struct vfio_dma *dma, 964 dma_addr_t base_iova, size_t pgsize) 965 { 966 unsigned long pgshift = __ffs(pgsize); 967 unsigned long nbits = dma->size >> pgshift; 968 unsigned long bit_offset = (dma->iova - base_iova) >> pgshift; 969 unsigned long copy_offset = bit_offset / BITS_PER_LONG; 970 unsigned long shift = bit_offset % BITS_PER_LONG; 971 unsigned long leftover; 972 973 /* mark all pages dirty if all pages are pinned and mapped. */ 974 if (dma->iommu_mapped) 975 bitmap_set(dma->bitmap, 0, nbits); 976 977 if (shift) { 978 bitmap_shift_left(dma->bitmap, dma->bitmap, shift, 979 nbits + shift); 980 > 981 if (copy_from_user(&leftover, (u64 *)bitmap + copy_offset, 982 sizeof(leftover))) 983 return -EFAULT; 984 985 bitmap_or(dma->bitmap, dma->bitmap, &leftover, shift); 986 } 987 > 988 if (copy_to_user((u64 *)bitmap + copy_offset, dma->bitmap, 989 DIRTY_BITMAP_BYTES(nbits + shift))) 990 return -EFAULT; 991 992 return 0; 993 } 994 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org