All of lore.kernel.org
 help / color / mirror / Atom feed
* [mips-linux:mips-next 73/76] arch/mips/kernel/unaligned.c:127:34: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2021-04-06 19:53 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-04-06 19:53 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 30065 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git mips-next
head:   7f028bff8a8e55a783eeb12e50bb3f5f18804459
commit: 45deb5faeb9e02951361ceba5ffee721745661c3 [73/76] MIPS: uaccess: Remove get_fs/set_fs call sites
config: mips-randconfig-s032-20210406 (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-279-g6d5d9b42-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=45deb5faeb9e02951361ceba5ffee721745661c3
        git remote add mips-linux https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git
        git fetch --no-tags mips-linux mips-next
        git checkout 45deb5faeb9e02951361ceba5ffee721745661c3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
>> arch/mips/kernel/unaligned.c:127:34: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected unsigned int [usertype] *p @@     got unsigned int [noderef] __user *pc @@
   arch/mips/kernel/unaligned.c:127:34: sparse:     expected unsigned int [usertype] *p
   arch/mips/kernel/unaligned.c:127:34: sparse:     got unsigned int [noderef] __user *pc
   arch/mips/kernel/unaligned.c:1475:17: sparse: sparse: symbol 'do_ade' was not declared. Should it be static?
   arch/mips/kernel/unaligned.c: note: in included file:
>> arch/mips/kernel/access-helper.h:17:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const [noderef] __user *__gu_ptr @@     got unsigned int [usertype] *p @@
   arch/mips/kernel/access-helper.h:17:23: sparse:     expected unsigned int const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:17:23: sparse:     got unsigned int [usertype] *p
--
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   arch/mips/kernel/traps.c:519:14: sparse: sparse: symbol 'll_bit' was not declared. Should it be static?
   arch/mips/kernel/traps.c:520:20: sparse: sparse: symbol 'll_task' was not declared. Should it be static?
   arch/mips/kernel/traps.c:746:17: sparse: sparse: symbol 'do_ov' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1023:17: sparse: sparse: symbol 'do_bp' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1110:17: sparse: sparse: symbol 'do_tr' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1174:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __user *fault_addr @@     got unsigned long * @@
   arch/mips/kernel/traps.c:1174:47: sparse:     expected void [noderef] __user *fault_addr
   arch/mips/kernel/traps.c:1174:47: sparse:     got unsigned long *
   arch/mips/kernel/traps.c:1147:17: sparse: sparse: symbol 'do_ri' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1398:17: sparse: sparse: symbol 'do_cpu' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1503:17: sparse: sparse: symbol 'do_msa_fpe' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1523:17: sparse: sparse: symbol 'do_msa' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1544:17: sparse: sparse: symbol 'do_mdmx' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1556:17: sparse: sparse: symbol 'do_watch' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1583:17: sparse: sparse: symbol 'do_mcheck' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1608:17: sparse: sparse: symbol 'do_mt' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1644:17: sparse: sparse: symbol 'do_dsp' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1652:17: sparse: sparse: symbol 'do_reserved' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1876:17: sparse: sparse: symbol 'do_ftlb' was not declared. Should it be static?
   arch/mips/kernel/traps.c:1905:17: sparse: sparse: symbol 'do_gsexc' was not declared. Should it be static?
   arch/mips/kernel/traps.c:2002:15: sparse: sparse: symbol 'vi_handlers' was not declared. Should it be static?
   arch/mips/kernel/traps.c: note: in included file:
>> arch/mips/kernel/access-helper.h:7:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned long const [noderef] __user *__gu_ptr @@     got unsigned long *p @@
   arch/mips/kernel/access-helper.h:7:23: sparse:     expected unsigned long const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:7:23: sparse:     got unsigned long *p
>> arch/mips/kernel/access-helper.h:7:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned long const [noderef] __user *__gu_ptr @@     got unsigned long *p @@
   arch/mips/kernel/access-helper.h:7:23: sparse:     expected unsigned long const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:7:23: sparse:     got unsigned long *p
>> arch/mips/kernel/access-helper.h:12:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned short const [noderef] __user *__gu_ptr @@     got unsigned short [usertype] *p @@
   arch/mips/kernel/access-helper.h:12:23: sparse:     expected unsigned short const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:12:23: sparse:     got unsigned short [usertype] *p
>> arch/mips/kernel/access-helper.h:17:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const [noderef] __user *__gu_ptr @@     got unsigned int [usertype] *p @@
   arch/mips/kernel/access-helper.h:17:23: sparse:     expected unsigned int const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:17:23: sparse:     got unsigned int [usertype] *p
>> arch/mips/kernel/access-helper.h:12:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned short const [noderef] __user *__gu_ptr @@     got unsigned short [usertype] *p @@
   arch/mips/kernel/access-helper.h:12:23: sparse:     expected unsigned short const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:12:23: sparse:     got unsigned short [usertype] *p
>> arch/mips/kernel/access-helper.h:12:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned short const [noderef] __user *__gu_ptr @@     got unsigned short [usertype] *p @@
   arch/mips/kernel/access-helper.h:12:23: sparse:     expected unsigned short const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:12:23: sparse:     got unsigned short [usertype] *p
>> arch/mips/kernel/access-helper.h:17:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const [noderef] __user *__gu_ptr @@     got unsigned int [usertype] *p @@
   arch/mips/kernel/access-helper.h:17:23: sparse:     expected unsigned int const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:17:23: sparse:     got unsigned int [usertype] *p
>> arch/mips/kernel/access-helper.h:12:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned short const [noderef] __user *__gu_ptr @@     got unsigned short [usertype] *p @@
   arch/mips/kernel/access-helper.h:12:23: sparse:     expected unsigned short const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:12:23: sparse:     got unsigned short [usertype] *p
>> arch/mips/kernel/access-helper.h:12:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned short const [noderef] __user *__gu_ptr @@     got unsigned short [usertype] *p @@
   arch/mips/kernel/access-helper.h:12:23: sparse:     expected unsigned short const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:12:23: sparse:     got unsigned short [usertype] *p
>> arch/mips/kernel/access-helper.h:17:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const [noderef] __user *__gu_ptr @@     got unsigned int [usertype] *p @@
   arch/mips/kernel/access-helper.h:17:23: sparse:     expected unsigned int const [noderef] __user *__gu_ptr
   arch/mips/kernel/access-helper.h:17:23: sparse:     got unsigned int [usertype] *p
   arch/mips/kernel/traps.c: note: in included file (through arch/mips/include/asm/mips-cps.h):
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:151:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:151:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *mem @@     got void * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void const volatile [noderef] __iomem *mem
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *
   arch/mips/include/asm/mips-cm.h:165:1: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     expected void *
   arch/mips/include/asm/mips-cm.h:165:1: sparse:     got void [noderef] __iomem *

vim +127 arch/mips/kernel/unaligned.c

   110	
   111	static void emulate_load_store_insn(struct pt_regs *regs,
   112		void __user *addr, unsigned int __user *pc)
   113	{
   114		unsigned long origpc, orig31, value;
   115		union mips_instruction insn;
   116		unsigned int res;
   117		bool user = user_mode(regs);
   118	
   119		origpc = (unsigned long)pc;
   120		orig31 = regs->regs[31];
   121	
   122		perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);
   123	
   124		/*
   125		 * This load never faults.
   126		 */
 > 127		__get_inst32(&insn.word, pc, user);
   128	
   129		switch (insn.i_format.opcode) {
   130			/*
   131			 * These are instructions that a compiler doesn't generate.  We
   132			 * can assume therefore that the code is MIPS-aware and
   133			 * really buggy.  Emulating these instructions would break the
   134			 * semantics anyway.
   135			 */
   136		case ll_op:
   137		case lld_op:
   138		case sc_op:
   139		case scd_op:
   140	
   141			/*
   142			 * For these instructions the only way to create an address
   143			 * error is an attempted access to kernel/supervisor address
   144			 * space.
   145			 */
   146		case ldl_op:
   147		case ldr_op:
   148		case lwl_op:
   149		case lwr_op:
   150		case sdl_op:
   151		case sdr_op:
   152		case swl_op:
   153		case swr_op:
   154		case lb_op:
   155		case lbu_op:
   156		case sb_op:
   157			goto sigbus;
   158	
   159			/*
   160			 * The remaining opcodes are the ones that are really of
   161			 * interest.
   162			 */
   163		case spec3_op:
   164			if (insn.dsp_format.func == lx_op) {
   165				switch (insn.dsp_format.op) {
   166				case lwx_op:
   167					if (user && !access_ok(addr, 4))
   168						goto sigbus;
   169					LoadW(addr, value, res);
   170					if (res)
   171						goto fault;
   172					compute_return_epc(regs);
   173					regs->regs[insn.dsp_format.rd] = value;
   174					break;
   175				case lhx_op:
   176					if (user && !access_ok(addr, 2))
   177						goto sigbus;
   178					LoadHW(addr, value, res);
   179					if (res)
   180						goto fault;
   181					compute_return_epc(regs);
   182					regs->regs[insn.dsp_format.rd] = value;
   183					break;
   184				default:
   185					goto sigill;
   186				}
   187			}
   188	#ifdef CONFIG_EVA
   189			else {
   190				/*
   191				 * we can land here only from kernel accessing user
   192				 * memory, so we need to "switch" the address limit to
   193				 * user space, so that address check can work properly.
   194				 */
   195				switch (insn.spec3_format.func) {
   196				case lhe_op:
   197					if (!access_ok(addr, 2))
   198						goto sigbus;
   199					LoadHWE(addr, value, res);
   200					if (res)
   201						goto fault;
   202					compute_return_epc(regs);
   203					regs->regs[insn.spec3_format.rt] = value;
   204					break;
   205				case lwe_op:
   206					if (!access_ok(addr, 4))
   207						goto sigbus;
   208					LoadWE(addr, value, res);
   209					if (res)
   210						goto fault;
   211					compute_return_epc(regs);
   212					regs->regs[insn.spec3_format.rt] = value;
   213					break;
   214				case lhue_op:
   215					if (!access_ok(addr, 2))
   216						goto sigbus;
   217					LoadHWUE(addr, value, res);
   218					if (res)
   219						goto fault;
   220					compute_return_epc(regs);
   221					regs->regs[insn.spec3_format.rt] = value;
   222					break;
   223				case she_op:
   224					if (!access_ok(addr, 2))
   225						goto sigbus;
   226					compute_return_epc(regs);
   227					value = regs->regs[insn.spec3_format.rt];
   228					StoreHWE(addr, value, res);
   229					if (res)
   230						goto fault;
   231					break;
   232				case swe_op:
   233					if (!access_ok(addr, 4))
   234						goto sigbus;
   235					compute_return_epc(regs);
   236					value = regs->regs[insn.spec3_format.rt];
   237					StoreWE(addr, value, res);
   238					if (res)
   239						goto fault;
   240					break;
   241				default:
   242					goto sigill;
   243				}
   244			}
   245	#endif
   246			break;
   247		case lh_op:
   248			if (user && !access_ok(addr, 2))
   249				goto sigbus;
   250	
   251			if (IS_ENABLED(CONFIG_EVA) && user)
   252				LoadHWE(addr, value, res);
   253			else
   254				LoadHW(addr, value, res);
   255	
   256			if (res)
   257				goto fault;
   258			compute_return_epc(regs);
   259			regs->regs[insn.i_format.rt] = value;
   260			break;
   261	
   262		case lw_op:
   263			if (user && !access_ok(addr, 4))
   264				goto sigbus;
   265	
   266			if (IS_ENABLED(CONFIG_EVA) && user)
   267				LoadWE(addr, value, res);
   268			else
   269				LoadW(addr, value, res);
   270	
   271			if (res)
   272				goto fault;
   273			compute_return_epc(regs);
   274			regs->regs[insn.i_format.rt] = value;
   275			break;
   276	
   277		case lhu_op:
   278			if (user && !access_ok(addr, 2))
   279				goto sigbus;
   280	
   281			if (IS_ENABLED(CONFIG_EVA) && user)
   282				LoadHWUE(addr, value, res);
   283			else
   284				LoadHWU(addr, value, res);
   285	
   286			if (res)
   287				goto fault;
   288			compute_return_epc(regs);
   289			regs->regs[insn.i_format.rt] = value;
   290			break;
   291	
   292		case lwu_op:
   293	#ifdef CONFIG_64BIT
   294			/*
   295			 * A 32-bit kernel might be running on a 64-bit processor.  But
   296			 * if we're on a 32-bit processor and an i-cache incoherency
   297			 * or race makes us see a 64-bit instruction here the sdl/sdr
   298			 * would blow up, so for now we don't handle unaligned 64-bit
   299			 * instructions on 32-bit kernels.
   300			 */
   301			if (user && !access_ok(addr, 4))
   302				goto sigbus;
   303	
   304			LoadWU(addr, value, res);
   305			if (res)
   306				goto fault;
   307			compute_return_epc(regs);
   308			regs->regs[insn.i_format.rt] = value;
   309			break;
   310	#endif /* CONFIG_64BIT */
   311	
   312			/* Cannot handle 64-bit instructions in 32-bit kernel */
   313			goto sigill;
   314	
   315		case ld_op:
   316	#ifdef CONFIG_64BIT
   317			/*
   318			 * A 32-bit kernel might be running on a 64-bit processor.  But
   319			 * if we're on a 32-bit processor and an i-cache incoherency
   320			 * or race makes us see a 64-bit instruction here the sdl/sdr
   321			 * would blow up, so for now we don't handle unaligned 64-bit
   322			 * instructions on 32-bit kernels.
   323			 */
   324			if (user && !access_ok(addr, 8))
   325				goto sigbus;
   326	
   327			LoadDW(addr, value, res);
   328			if (res)
   329				goto fault;
   330			compute_return_epc(regs);
   331			regs->regs[insn.i_format.rt] = value;
   332			break;
   333	#endif /* CONFIG_64BIT */
   334	
   335			/* Cannot handle 64-bit instructions in 32-bit kernel */
   336			goto sigill;
   337	
   338		case sh_op:
   339			if (user && !access_ok(addr, 2))
   340				goto sigbus;
   341	
   342			compute_return_epc(regs);
   343			value = regs->regs[insn.i_format.rt];
   344	
   345			if (IS_ENABLED(CONFIG_EVA) && user)
   346				StoreHWE(addr, value, res);
   347			else
   348				StoreHW(addr, value, res);
   349	
   350			if (res)
   351				goto fault;
   352			break;
   353	
   354		case sw_op:
   355			if (user && !access_ok(addr, 4))
   356				goto sigbus;
   357	
   358			compute_return_epc(regs);
   359			value = regs->regs[insn.i_format.rt];
   360	
   361			if (IS_ENABLED(CONFIG_EVA) && user)
   362				StoreWE(addr, value, res);
   363			else
   364				StoreW(addr, value, res);
   365	
   366			if (res)
   367				goto fault;
   368			break;
   369	
   370		case sd_op:
   371	#ifdef CONFIG_64BIT
   372			/*
   373			 * A 32-bit kernel might be running on a 64-bit processor.  But
   374			 * if we're on a 32-bit processor and an i-cache incoherency
   375			 * or race makes us see a 64-bit instruction here the sdl/sdr
   376			 * would blow up, so for now we don't handle unaligned 64-bit
   377			 * instructions on 32-bit kernels.
   378			 */
   379			if (user && !access_ok(addr, 8))
   380				goto sigbus;
   381	
   382			compute_return_epc(regs);
   383			value = regs->regs[insn.i_format.rt];
   384			StoreDW(addr, value, res);
   385			if (res)
   386				goto fault;
   387			break;
   388	#endif /* CONFIG_64BIT */
   389	
   390			/* Cannot handle 64-bit instructions in 32-bit kernel */
   391			goto sigill;
   392	

---
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: 35845 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-06 19:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 19:53 [mips-linux:mips-next 73/76] arch/mips/kernel/unaligned.c:127:34: sparse: sparse: incorrect type in argument 2 (different address spaces) 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.