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:   791c8ab095f71327899023223940dd52257a4173
commit: 4ec4190be4cf9cc3e0ccaf5f155a5f9066d18950 kasan, x86: don't rename memintrinsics in uninstrumented files
date:   9 months ago
config: x86_64-randconfig-123-20231118 (https://download.01.org/0day-ci/archive/20231118/202311180934.gY2s81r5-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231118/202311180934.gY2s81r5-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/202311180934.gY2s81r5-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 *p @@     got void [noderef] __user *[addressable] ubuf @@
   drivers/misc/sgi-gru/grukdump.c:60:17: sparse:     expected void *p
   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

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