[gerg-m68knommu:armnommu 3/3] arch/arm/mm/alignment.c:776:25: sparse: sparse: incorrect type in argument 1 (different address spaces)

kernel test robot <[email protected]>
Newsgroups org.kernel.vger.linux-m68k,dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git armnommu
head:   b9d1c6c54795dbb93bb9f68f60a4da071e2ad418
commit: b9d1c6c54795dbb93bb9f68f60a4da071e2ad418 [3/3] ARM: versatile: support configuring versatile machine for no-MMU
config: arm-randconfig-r132-20260519 (https://download.01.org/0day-ci/archive/20260519/[email protected]/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260519/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> arch/arm/mm/alignment.c:776:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] *ip @@
   arch/arm/mm/alignment.c:776:25: sparse:     expected void const volatile [noderef] __user *ptr
   arch/arm/mm/alignment.c:776:25: sparse:     got unsigned int [usertype] *ip
>> arch/arm/mm/alignment.c:791:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned short [usertype] *ip @@
   arch/arm/mm/alignment.c:791:25: sparse:     expected void const volatile [noderef] __user *ptr
   arch/arm/mm/alignment.c:791:25: sparse:     got unsigned short [usertype] *ip

vim +776 arch/arm/mm/alignment.c

c2860d43f5dfab59 George G. Davis   2009-06-04  769  
1bb9fb0a147f9db1 Russell King      2019-09-06  770  static int alignment_get_arm(struct pt_regs *regs, u32 *ip, u32 *inst)
67e15fa5b487adb9 Russell King      2019-08-31  771  {
67e15fa5b487adb9 Russell King      2019-08-31  772  	u32 instr = 0;
67e15fa5b487adb9 Russell King      2019-08-31  773  	int fault;
67e15fa5b487adb9 Russell King      2019-08-31  774  
67e15fa5b487adb9 Russell King      2019-08-31  775  	if (user_mode(regs))
67e15fa5b487adb9 Russell King      2019-08-31 @776  		fault = get_user(instr, ip);
67e15fa5b487adb9 Russell King      2019-08-31  777  	else
25f12ae45fc1931a Christoph Hellwig 2020-06-17  778  		fault = get_kernel_nofault(instr, ip);
67e15fa5b487adb9 Russell King      2019-08-31  779  
67e15fa5b487adb9 Russell King      2019-08-31  780  	*inst = __mem_to_opcode_arm(instr);
67e15fa5b487adb9 Russell King      2019-08-31  781  
67e15fa5b487adb9 Russell King      2019-08-31  782  	return fault;
67e15fa5b487adb9 Russell King      2019-08-31  783  }
67e15fa5b487adb9 Russell King      2019-08-31  784  
67e15fa5b487adb9 Russell King      2019-08-31  785  static int alignment_get_thumb(struct pt_regs *regs, u16 *ip, u16 *inst)
67e15fa5b487adb9 Russell King      2019-08-31  786  {
67e15fa5b487adb9 Russell King      2019-08-31  787  	u16 instr = 0;
67e15fa5b487adb9 Russell King      2019-08-31  788  	int fault;
67e15fa5b487adb9 Russell King      2019-08-31  789  
67e15fa5b487adb9 Russell King      2019-08-31  790  	if (user_mode(regs))
67e15fa5b487adb9 Russell King      2019-08-31 @791  		fault = get_user(instr, ip);
67e15fa5b487adb9 Russell King      2019-08-31  792  	else
25f12ae45fc1931a Christoph Hellwig 2020-06-17  793  		fault = get_kernel_nofault(instr, ip);
67e15fa5b487adb9 Russell King      2019-08-31  794  
67e15fa5b487adb9 Russell King      2019-08-31  795  	*inst = __mem_to_opcode_thumb16(instr);
67e15fa5b487adb9 Russell King      2019-08-31  796  
67e15fa5b487adb9 Russell King      2019-08-31  797  	return fault;
67e15fa5b487adb9 Russell King      2019-08-31  798  }
67e15fa5b487adb9 Russell King      2019-08-31  799  

:::::: The code at line 776 was first introduced by commit
:::::: 67e15fa5b487adb9b78a92789eeff2d6ec8f5cee ARM: mm: fix alignment handler faults under memory pressure

:::::: TO: Russell King <[email protected]>
:::::: CC: Russell King <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.