tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-4.19-stable head: 22fdca5318397c60f564ba993e10e37af63a2c37 commit: f2f1b3a34f06424b4b67fce30be2347d4fe5a213 [7048/9999] ARCv2: save ABI registers across signal handling config: arc-randconfig-s033-20221106 compiler: arceb-elf-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty # https://github.com/ammarfaizi2/linux-block/commit/f2f1b3a34f06424b4b67fce30be2347d4fe5a213 git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android-4.19-stable git checkout f2f1b3a34f06424b4b67fce30be2347d4fe5a213 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash arch/arc/kernel/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> arch/arc/kernel/signal.c:80:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] *to @@ got struct user_regs_arcv2 * @@ arch/arc/kernel/signal.c:80:31: sparse: expected void [noderef] *to arch/arc/kernel/signal.c:80:31: sparse: got struct user_regs_arcv2 * >> arch/arc/kernel/signal.c:91:41: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] *from @@ got struct user_regs_arcv2 * @@ arch/arc/kernel/signal.c:91:41: sparse: expected void const [noderef] *from arch/arc/kernel/signal.c:91:41: sparse: got struct user_regs_arcv2 * >> arch/arc/kernel/signal.c:137:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sigcontext *mctx @@ got struct sigcontext [noderef] * @@ arch/arc/kernel/signal.c:137:42: sparse: expected struct sigcontext *mctx arch/arc/kernel/signal.c:137:42: sparse: got struct sigcontext [noderef] * arch/arc/kernel/signal.c:156:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sigcontext *mctx @@ got struct sigcontext [noderef] * @@ arch/arc/kernel/signal.c:156:45: sparse: expected struct sigcontext *mctx arch/arc/kernel/signal.c:156:45: sparse: got struct sigcontext [noderef] * arch/arc/kernel/signal.c:404:6: warning: no previous prototype for 'do_signal' [-Wmissing-prototypes] 404 | void do_signal(struct pt_regs *regs) | ^~~~~~~~~ arch/arc/kernel/signal.c:437:6: warning: no previous prototype for 'do_notify_resume' [-Wmissing-prototypes] 437 | void do_notify_resume(struct pt_regs *regs) | ^~~~~~~~~~~~~~~~ vim +80 arch/arc/kernel/signal.c 66 67 static int save_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs) 68 { 69 int err = 0; 70 #ifndef CONFIG_ISA_ARCOMPACT 71 struct user_regs_arcv2 v2abi; 72 73 v2abi.r30 = regs->r30; 74 #ifdef CONFIG_ARC_HAS_ACCL_REGS 75 v2abi.r58 = regs->r58; 76 v2abi.r59 = regs->r59; 77 #else 78 v2abi.r58 = v2abi.r59 = 0; 79 #endif > 80 err = __copy_to_user(&mctx->v2abi, &v2abi, sizeof(v2abi)); 81 #endif 82 return err; 83 } 84 85 static int restore_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs) 86 { 87 int err = 0; 88 #ifndef CONFIG_ISA_ARCOMPACT 89 struct user_regs_arcv2 v2abi; 90 > 91 err = __copy_from_user(&v2abi, &mctx->v2abi, sizeof(v2abi)); 92 93 regs->r30 = v2abi.r30; 94 #ifdef CONFIG_ARC_HAS_ACCL_REGS 95 regs->r58 = v2abi.r58; 96 regs->r59 = v2abi.r59; 97 #endif 98 #endif 99 return err; 100 } 101 102 static int 103 stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, 104 sigset_t *set) 105 { 106 int err; 107 struct user_regs_struct uregs; 108 109 uregs.scratch.bta = regs->bta; 110 uregs.scratch.lp_start = regs->lp_start; 111 uregs.scratch.lp_end = regs->lp_end; 112 uregs.scratch.lp_count = regs->lp_count; 113 uregs.scratch.status32 = regs->status32; 114 uregs.scratch.ret = regs->ret; 115 uregs.scratch.blink = regs->blink; 116 uregs.scratch.fp = regs->fp; 117 uregs.scratch.gp = regs->r26; 118 uregs.scratch.r12 = regs->r12; 119 uregs.scratch.r11 = regs->r11; 120 uregs.scratch.r10 = regs->r10; 121 uregs.scratch.r9 = regs->r9; 122 uregs.scratch.r8 = regs->r8; 123 uregs.scratch.r7 = regs->r7; 124 uregs.scratch.r6 = regs->r6; 125 uregs.scratch.r5 = regs->r5; 126 uregs.scratch.r4 = regs->r4; 127 uregs.scratch.r3 = regs->r3; 128 uregs.scratch.r2 = regs->r2; 129 uregs.scratch.r1 = regs->r1; 130 uregs.scratch.r0 = regs->r0; 131 uregs.scratch.sp = regs->sp; 132 133 err = __copy_to_user(&(sf->uc.uc_mcontext.regs.scratch), &uregs.scratch, 134 sizeof(sf->uc.uc_mcontext.regs.scratch)); 135 136 if (is_isa_arcv2()) > 137 err |= save_arcv2_regs(&(sf->uc.uc_mcontext), regs); 138 139 err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t)); 140 141 return err ? -EFAULT : 0; 142 } 143 -- 0-DAY CI Kernel Test Service https://01.org/lkp