drivers/misc/sgi-gru/grukdump.c:60:17: sparse: sparse: incorrect type in argument 1 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4bbf9020becbfd8fc2c3da790855b7042fad455b
commit: 2e577732e8d28b9183df701fb90cb7943aa4ed16 kasan, fortify: properly rename memintrinsics
date:   7 months ago
config: x86_64-randconfig-r111-20241223 (https://download.01.org/0day-ci/archive/20241223/202412232152.PiRThU4w-lkp@xxxxxxxxx/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241223/202412232152.PiRThU4w-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412232152.PiRThU4w-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got void [noderef] __user *[addressable] ubuf @@
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse:     expected void const *
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse:     got void [noderef] __user *[addressable] ubuf
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got void [noderef] __user *[addressable] ubuf @@
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse:     expected void const *
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse:     got void [noderef] __user *[addressable] ubuf
>> drivers/misc/sgi-gru/grukdump.c:60:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void * @@     got void [noderef] __user *[addressable] ubuf @@
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse:     expected void *
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse:     got void [noderef] __user *[addressable] ubuf
   drivers/misc/sgi-gru/grukdump.c:129:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct gru_context_configuration_handle *ubufcch @@     got void [noderef] __user *[assigned] ubuf @@
   drivers/misc/sgi-gru/grukdump.c:129:17: sparse:     expected struct gru_context_configuration_handle *ubufcch
   drivers/misc/sgi-gru/grukdump.c:129:17: sparse:     got void [noderef] __user *[assigned] ubuf
   drivers/misc/sgi-gru/grukdump.c:192:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __user *ubuf @@     got void *[addressable] [assigned] buf @@
   drivers/misc/sgi-gru/grukdump.c:192:14: sparse:     expected void [noderef] __user *ubuf
   drivers/misc/sgi-gru/grukdump.c:192:14: sparse:     got void *[addressable] [assigned] buf
   drivers/misc/sgi-gru/grukdump.c:193:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __user *ubufend @@     got void * @@
   drivers/misc/sgi-gru/grukdump.c:193:17: sparse:     expected void [noderef] __user *ubufend
   drivers/misc/sgi-gru/grukdump.c:193:17: sparse:     got void *

vim +60 drivers/misc/sgi-gru/grukdump.c

9cc9b056ea51608 Jack Steiner 2009-06-17  34  
9cc9b056ea51608 Jack Steiner 2009-06-17  35  static int gru_dump_context_data(void *grubase,
9cc9b056ea51608 Jack Steiner 2009-06-17  36  			struct gru_context_configuration_handle *cch,
b8229bedd1f3979 Jack Steiner 2009-12-15  37  			void __user *ubuf, int ctxnum, int dsrcnt,
b8229bedd1f3979 Jack Steiner 2009-12-15  38  			int flush_cbrs)
9cc9b056ea51608 Jack Steiner 2009-06-17  39  {
9cc9b056ea51608 Jack Steiner 2009-06-17  40  	void *cb, *cbe, *tfh, *gseg;
9cc9b056ea51608 Jack Steiner 2009-06-17  41  	int i, scr;
9cc9b056ea51608 Jack Steiner 2009-06-17  42  
9cc9b056ea51608 Jack Steiner 2009-06-17  43  	gseg = grubase + ctxnum * GRU_GSEG_STRIDE;
9cc9b056ea51608 Jack Steiner 2009-06-17  44  	cb = gseg + GRU_CB_BASE;
9cc9b056ea51608 Jack Steiner 2009-06-17  45  	cbe = grubase + GRU_CBE_BASE;
9cc9b056ea51608 Jack Steiner 2009-06-17  46  	tfh = grubase + GRU_TFH_BASE;
9cc9b056ea51608 Jack Steiner 2009-06-17  47  
9cc9b056ea51608 Jack Steiner 2009-06-17  48  	for_each_cbr_in_allocation_map(i, &cch->cbr_allocation_map, scr) {
b8229bedd1f3979 Jack Steiner 2009-12-15  49  		if (flush_cbrs)
b8229bedd1f3979 Jack Steiner 2009-12-15  50  			gru_flush_cache(cb);
9cc9b056ea51608 Jack Steiner 2009-06-17  51  		if (gru_user_copy_handle(&ubuf, cb))
9cc9b056ea51608 Jack Steiner 2009-06-17  52  			goto fail;
9cc9b056ea51608 Jack Steiner 2009-06-17  53  		if (gru_user_copy_handle(&ubuf, tfh + i * GRU_HANDLE_STRIDE))
9cc9b056ea51608 Jack Steiner 2009-06-17  54  			goto fail;
9cc9b056ea51608 Jack Steiner 2009-06-17  55  		if (gru_user_copy_handle(&ubuf, cbe + i * GRU_HANDLE_STRIDE))
9cc9b056ea51608 Jack Steiner 2009-06-17  56  			goto fail;
9cc9b056ea51608 Jack Steiner 2009-06-17  57  		cb += GRU_HANDLE_STRIDE;
9cc9b056ea51608 Jack Steiner 2009-06-17  58  	}
9cc9b056ea51608 Jack Steiner 2009-06-17  59  	if (dsrcnt)
9cc9b056ea51608 Jack Steiner 2009-06-17 @60  		memcpy(ubuf, gseg + GRU_DS_BASE, dsrcnt * GRU_HANDLE_STRIDE);
9cc9b056ea51608 Jack Steiner 2009-06-17  61  	return 0;
9cc9b056ea51608 Jack Steiner 2009-06-17  62  
9cc9b056ea51608 Jack Steiner 2009-06-17  63  fail:
9cc9b056ea51608 Jack Steiner 2009-06-17  64  	return -EFAULT;
9cc9b056ea51608 Jack Steiner 2009-06-17  65  }
9cc9b056ea51608 Jack Steiner 2009-06-17  66  

:::::: The code at line 60 was first introduced by commit
:::::: 9cc9b056ea51608788609d7e26c7db55ef81bb2e gru: dump chiplet state

:::::: TO: Jack Steiner <steiner@xxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux