* drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
@ 2021-11-14 7:22 kernel test robot
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-14 7:22 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3065 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Xie Yongji <xieyongji@bytedance.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
Hi Xie,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c8c109546a19613d323a319d0c921cb1f317e629
commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
date: 10 weeks ago
:::::: branch date: 8 hours ago
:::::: commit date: 10 weeks ago
config: powerpc-randconfig-m031-20211016 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
vim +305 drivers/vdpa/vdpa_user/iova_domain.c
8c773d53fb7b64 Xie Yongji 2021-08-31 286
8c773d53fb7b64 Xie Yongji 2021-08-31 287 static dma_addr_t
8c773d53fb7b64 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
8c773d53fb7b64 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
8c773d53fb7b64 Xie Yongji 2021-08-31 290 {
8c773d53fb7b64 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
8c773d53fb7b64 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
8c773d53fb7b64 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
8c773d53fb7b64 Xie Yongji 2021-08-31 294
8c773d53fb7b64 Xie Yongji 2021-08-31 295 /*
8c773d53fb7b64 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
8c773d53fb7b64 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
8c773d53fb7b64 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
8c773d53fb7b64 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
8c773d53fb7b64 Xie Yongji 2021-08-31 300 */
8c773d53fb7b64 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
8c773d53fb7b64 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
8c773d53fb7b64 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
8c773d53fb7b64 Xie Yongji 2021-08-31 304
8c773d53fb7b64 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
8c773d53fb7b64 Xie Yongji 2021-08-31 306 }
8c773d53fb7b64 Xie Yongji 2021-08-31 307
:::::: The code@line 305 was first introduced by commit
:::::: 8c773d53fb7b64267b0f55c1d3517cb8c5e29b3c vduse: Implement an MMU-based software IOTLB
:::::: TO: Xie Yongji <xieyongji@bytedance.com>
:::::: CC: Michael S. Tsirkin <mst@redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39021 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
@ 2021-11-19 5:13 kernel test robot
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-19 5:13 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3087 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Xie Yongji <xieyongji@bytedance.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
Hi Xie,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4c388a8e740d3235a194f330c8ef327deef710f6
commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
date: 2 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 2 months ago
config: arm-randconfig-m031-20211116 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
vim +305 drivers/vdpa/vdpa_user/iova_domain.c
8c773d53fb7b642 Xie Yongji 2021-08-31 286
8c773d53fb7b642 Xie Yongji 2021-08-31 287 static dma_addr_t
8c773d53fb7b642 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
8c773d53fb7b642 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
8c773d53fb7b642 Xie Yongji 2021-08-31 290 {
8c773d53fb7b642 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
8c773d53fb7b642 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
8c773d53fb7b642 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
8c773d53fb7b642 Xie Yongji 2021-08-31 294
8c773d53fb7b642 Xie Yongji 2021-08-31 295 /*
8c773d53fb7b642 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
8c773d53fb7b642 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
8c773d53fb7b642 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
8c773d53fb7b642 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
8c773d53fb7b642 Xie Yongji 2021-08-31 300 */
8c773d53fb7b642 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
8c773d53fb7b642 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
8c773d53fb7b642 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
8c773d53fb7b642 Xie Yongji 2021-08-31 304
8c773d53fb7b642 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
8c773d53fb7b642 Xie Yongji 2021-08-31 306 }
8c773d53fb7b642 Xie Yongji 2021-08-31 307
:::::: The code@line 305 was first introduced by commit
:::::: 8c773d53fb7b64267b0f55c1d3517cb8c5e29b3c vduse: Implement an MMU-based software IOTLB
:::::: TO: Xie Yongji <xieyongji@bytedance.com>
:::::: CC: Michael S. Tsirkin <mst@redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36647 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
@ 2021-12-16 18:11 kernel test robot
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-12-16 18:11 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3102 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Xie Yongji <xieyongji@bytedance.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2b14864acbaaf03d9c01982e243a84632524c3ac
commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
date: 3 months ago
:::::: branch date: 23 hours ago
:::::: commit date: 3 months ago
config: i386-randconfig-m021-20211216 (https://download.01.org/0day-ci/archive/20211217/202112170217.0LXGLvEY-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
vim +305 drivers/vdpa/vdpa_user/iova_domain.c
8c773d53fb7b642 Xie Yongji 2021-08-31 286
8c773d53fb7b642 Xie Yongji 2021-08-31 287 static dma_addr_t
8c773d53fb7b642 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
8c773d53fb7b642 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
8c773d53fb7b642 Xie Yongji 2021-08-31 290 {
8c773d53fb7b642 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
8c773d53fb7b642 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
8c773d53fb7b642 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
8c773d53fb7b642 Xie Yongji 2021-08-31 294
8c773d53fb7b642 Xie Yongji 2021-08-31 295 /*
8c773d53fb7b642 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
8c773d53fb7b642 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
8c773d53fb7b642 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
8c773d53fb7b642 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
8c773d53fb7b642 Xie Yongji 2021-08-31 300 */
8c773d53fb7b642 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
8c773d53fb7b642 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
8c773d53fb7b642 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
8c773d53fb7b642 Xie Yongji 2021-08-31 304
8c773d53fb7b642 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
8c773d53fb7b642 Xie Yongji 2021-08-31 306 }
8c773d53fb7b642 Xie Yongji 2021-08-31 307
:::::: The code@line 305 was first introduced by commit
:::::: 8c773d53fb7b64267b0f55c1d3517cb8c5e29b3c vduse: Implement an MMU-based software IOTLB
:::::: TO: Xie Yongji <xieyongji@bytedance.com>
:::::: CC: Michael S. Tsirkin <mst@redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
@ 2022-01-19 4:44 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2022-01-17 6:13 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3138 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Xie Yongji <xieyongji@bytedance.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
Hi Xie,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 79e06c4c4950be2abd8ca5d2428a8c915aa62c24
commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
date: 4 months ago
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago
config: arm-randconfig-m031-20220116 (https://download.01.org/0day-ci/archive/20220117/202201171409.rqbXNHlz-lkp(a)intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
vim +305 drivers/vdpa/vdpa_user/iova_domain.c
8c773d53fb7b64 Xie Yongji 2021-08-31 286
8c773d53fb7b64 Xie Yongji 2021-08-31 287 static dma_addr_t
8c773d53fb7b64 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
8c773d53fb7b64 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
8c773d53fb7b64 Xie Yongji 2021-08-31 290 {
8c773d53fb7b64 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
8c773d53fb7b64 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
8c773d53fb7b64 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
8c773d53fb7b64 Xie Yongji 2021-08-31 294
8c773d53fb7b64 Xie Yongji 2021-08-31 295 /*
8c773d53fb7b64 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
8c773d53fb7b64 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
8c773d53fb7b64 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
8c773d53fb7b64 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
8c773d53fb7b64 Xie Yongji 2021-08-31 300 */
8c773d53fb7b64 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
8c773d53fb7b64 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
8c773d53fb7b64 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
8c773d53fb7b64 Xie Yongji 2021-08-31 304
8c773d53fb7b64 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
8c773d53fb7b64 Xie Yongji 2021-08-31 306 }
8c773d53fb7b64 Xie Yongji 2021-08-31 307
:::::: The code@line 305 was first introduced by commit
:::::: 8c773d53fb7b64267b0f55c1d3517cb8c5e29b3c vduse: Implement an MMU-based software IOTLB
:::::: TO: Xie Yongji <xieyongji@bytedance.com>
:::::: CC: Michael S. Tsirkin <mst@redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
@ 2022-01-19 4:44 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2022-01-19 4:44 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2621 bytes --]
Hi Xie,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 79e06c4c4950be2abd8ca5d2428a8c915aa62c24
commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
config: arm-randconfig-m031-20220116 (https://download.01.org/0day-ci/archive/20220117/202201171409.rqbXNHlz-lkp(a)intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
vim +305 drivers/vdpa/vdpa_user/iova_domain.c
8c773d53fb7b64 Xie Yongji 2021-08-31 287 static dma_addr_t
8c773d53fb7b64 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
8c773d53fb7b64 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
8c773d53fb7b64 Xie Yongji 2021-08-31 290 {
8c773d53fb7b64 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
8c773d53fb7b64 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
8c773d53fb7b64 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
8c773d53fb7b64 Xie Yongji 2021-08-31 294
8c773d53fb7b64 Xie Yongji 2021-08-31 295 /*
8c773d53fb7b64 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
8c773d53fb7b64 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
8c773d53fb7b64 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
8c773d53fb7b64 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
8c773d53fb7b64 Xie Yongji 2021-08-31 300 */
8c773d53fb7b64 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
8c773d53fb7b64 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
8c773d53fb7b64 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
8c773d53fb7b64 Xie Yongji 2021-08-31 304
8c773d53fb7b64 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
I feel like iova_pfn should probably be declared as dma_addr_t?
8c773d53fb7b64 Xie Yongji 2021-08-31 306 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
@ 2022-01-19 4:44 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2022-01-19 4:44 UTC (permalink / raw)
To: kbuild, Xie Yongji; +Cc: lkp, kbuild-all, linux-kernel, Michael S. Tsirkin
Hi Xie,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 79e06c4c4950be2abd8ca5d2428a8c915aa62c24
commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
config: arm-randconfig-m031-20220116 (https://download.01.org/0day-ci/archive/20220117/202201171409.rqbXNHlz-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
vim +305 drivers/vdpa/vdpa_user/iova_domain.c
8c773d53fb7b64 Xie Yongji 2021-08-31 287 static dma_addr_t
8c773d53fb7b64 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
8c773d53fb7b64 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
8c773d53fb7b64 Xie Yongji 2021-08-31 290 {
8c773d53fb7b64 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
8c773d53fb7b64 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
8c773d53fb7b64 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
8c773d53fb7b64 Xie Yongji 2021-08-31 294
8c773d53fb7b64 Xie Yongji 2021-08-31 295 /*
8c773d53fb7b64 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
8c773d53fb7b64 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
8c773d53fb7b64 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
8c773d53fb7b64 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
8c773d53fb7b64 Xie Yongji 2021-08-31 300 */
8c773d53fb7b64 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
8c773d53fb7b64 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
8c773d53fb7b64 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
8c773d53fb7b64 Xie Yongji 2021-08-31 304
8c773d53fb7b64 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
I feel like iova_pfn should probably be declared as dma_addr_t?
8c773d53fb7b64 Xie Yongji 2021-08-31 306 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
2022-01-19 4:44 ` Dan Carpenter
@ 2022-01-19 5:20 ` Yongji Xie
-1 siblings, 0 replies; 8+ messages in thread
From: Yongji Xie @ 2022-01-19 5:20 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]
On Wed, Jan 19, 2022 at 12:44 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hi Xie,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 79e06c4c4950be2abd8ca5d2428a8c915aa62c24
> commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
> config: arm-randconfig-m031-20220116 (https://download.01.org/0day-ci/archive/20220117/202201171409.rqbXNHlz-lkp(a)intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
>
> vim +305 drivers/vdpa/vdpa_user/iova_domain.c
>
> 8c773d53fb7b64 Xie Yongji 2021-08-31 287 static dma_addr_t
> 8c773d53fb7b64 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
> 8c773d53fb7b64 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
> 8c773d53fb7b64 Xie Yongji 2021-08-31 290 {
> 8c773d53fb7b64 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
> 8c773d53fb7b64 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
> 8c773d53fb7b64 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
> 8c773d53fb7b64 Xie Yongji 2021-08-31 294
> 8c773d53fb7b64 Xie Yongji 2021-08-31 295 /*
> 8c773d53fb7b64 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
> 8c773d53fb7b64 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
> 8c773d53fb7b64 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
> 8c773d53fb7b64 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
> 8c773d53fb7b64 Xie Yongji 2021-08-31 300 */
> 8c773d53fb7b64 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
> 8c773d53fb7b64 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
> 8c773d53fb7b64 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
> 8c773d53fb7b64 Xie Yongji 2021-08-31 304
> 8c773d53fb7b64 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
>
> I feel like iova_pfn should probably be declared as dma_addr_t?
>
Yes, I think we need something like:
return (dma_addr_t)iova_pfn << shift;
Thanks,
Yongji
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
@ 2022-01-19 5:20 ` Yongji Xie
0 siblings, 0 replies; 8+ messages in thread
From: Yongji Xie @ 2022-01-19 5:20 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kbuild, lkp, kbuild-all, linux-kernel, Michael S. Tsirkin
On Wed, Jan 19, 2022 at 12:44 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hi Xie,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 79e06c4c4950be2abd8ca5d2428a8c915aa62c24
> commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
> config: arm-randconfig-m031-20220116 (https://download.01.org/0day-ci/archive/20220117/202201171409.rqbXNHlz-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
>
> vim +305 drivers/vdpa/vdpa_user/iova_domain.c
>
> 8c773d53fb7b64 Xie Yongji 2021-08-31 287 static dma_addr_t
> 8c773d53fb7b64 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
> 8c773d53fb7b64 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
> 8c773d53fb7b64 Xie Yongji 2021-08-31 290 {
> 8c773d53fb7b64 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
> 8c773d53fb7b64 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
> 8c773d53fb7b64 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
> 8c773d53fb7b64 Xie Yongji 2021-08-31 294
> 8c773d53fb7b64 Xie Yongji 2021-08-31 295 /*
> 8c773d53fb7b64 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
> 8c773d53fb7b64 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
> 8c773d53fb7b64 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
> 8c773d53fb7b64 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
> 8c773d53fb7b64 Xie Yongji 2021-08-31 300 */
> 8c773d53fb7b64 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
> 8c773d53fb7b64 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
> 8c773d53fb7b64 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
> 8c773d53fb7b64 Xie Yongji 2021-08-31 304
> 8c773d53fb7b64 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
>
> I feel like iova_pfn should probably be declared as dma_addr_t?
>
Yes, I think we need something like:
return (dma_addr_t)iova_pfn << shift;
Thanks,
Yongji
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-01-19 5:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-16 18:11 drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type? kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-01-17 6:13 kernel test robot
2022-01-19 4:44 ` Dan Carpenter
2022-01-19 4:44 ` Dan Carpenter
2022-01-19 5:20 ` Yongji Xie
2022-01-19 5:20 ` Yongji Xie
2021-11-19 5:13 kernel test robot
2021-11-14 7:22 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.