Hi Christophe, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on linus/master v5.9-rc2 next-20200827] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc-Switch-signal-32-to-using-unsafe_put_user-and-friends/20200819-012411 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc64-randconfig-r005-20200827 (attached as .config) compiler: powerpc-linux-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): arch/powerpc/kernel/signal_32.c: In function 'save_user_regs_unsafe': >> arch/powerpc/kernel/signal_32.c:314:34: error: macro "unsafe_copy_to_user" requires 4 arguments, but only 3 given 314 | ELF_NEVRREG * sizeof(u32)), failed); | ^ In file included from include/linux/uaccess.h:9, from include/linux/sched/task.h:11, from include/linux/sched/signal.h:9, from include/linux/rcuwait.h:6, from include/linux/percpu-rwsem.h:7, from include/linux/fs.h:33, from include/linux/huge_mm.h:8, from include/linux/mm.h:672, from arch/powerpc/kernel/signal_32.c:17: arch/powerpc/include/asm/uaccess.h:605: note: macro "unsafe_copy_to_user" defined here 605 | #define unsafe_copy_to_user(d, s, l, e) \ | >> arch/powerpc/kernel/signal_32.c:313:3: error: 'unsafe_copy_to_user' undeclared (first use in this function); did you mean 'raw_copy_to_user'? 313 | unsafe_copy_to_user(&frame->mc_vregs, current->thread.evr, | ^~~~~~~~~~~~~~~~~~~ | raw_copy_to_user arch/powerpc/kernel/signal_32.c:313:3: note: each undeclared identifier is reported only once for each function it appears in >> arch/powerpc/kernel/signal_32.c:314:37: error: 'failed' undeclared (first use in this function) 314 | ELF_NEVRREG * sizeof(u32)), failed); | ^~~~~~ arch/powerpc/kernel/signal_32.c:314:35: warning: left-hand operand of comma expression has no effect [-Wunused-value] 314 | ELF_NEVRREG * sizeof(u32)), failed); | ^ >> arch/powerpc/kernel/signal_32.c:314:43: error: expected ';' before ')' token 314 | ELF_NEVRREG * sizeof(u32)), failed); | ^ | ; >> arch/powerpc/kernel/signal_32.c:314:43: error: expected statement before ')' token # https://github.com/0day-ci/linux/commit/2706ef40840de32202abda6d2d7e0c9ea96c511c git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Christophe-Leroy/powerpc-Switch-signal-32-to-using-unsafe_put_user-and-friends/20200819-012411 git checkout 2706ef40840de32202abda6d2d7e0c9ea96c511c vim +/unsafe_copy_to_user +314 arch/powerpc/kernel/signal_32.c 262 263 static int save_user_regs_unsafe(struct pt_regs *regs, struct mcontext __user *frame, 264 struct mcontext __user *tm_frame, int ctx_has_vsx_region) 265 { 266 unsigned long msr = regs->msr; 267 268 /* save general registers */ 269 unsafe_save_general_regs(regs, frame, failed); 270 271 #ifdef CONFIG_ALTIVEC 272 /* save altivec registers */ 273 if (current->thread.used_vr) { 274 unsafe_copy_to_user(&frame->mc_vregs, ¤t->thread.vr_state, 275 ELF_NVRREG * sizeof(vector128), failed); 276 /* set MSR_VEC in the saved MSR value to indicate that 277 frame->mc_vregs contains valid data */ 278 msr |= MSR_VEC; 279 } 280 /* else assert((regs->msr & MSR_VEC) == 0) */ 281 282 /* We always copy to/from vrsave, it's 0 if we don't have or don't 283 * use altivec. Since VSCR only contains 32 bits saved in the least 284 * significant bits of a vector, we "cheat" and stuff VRSAVE in the 285 * most significant bits of that same vector. --BenH 286 * Note that the current VRSAVE value is in the SPR at this point. 287 */ 288 unsafe_put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32], 289 failed); 290 #endif /* CONFIG_ALTIVEC */ 291 unsafe_copy_fpr_to_user(&frame->mc_fregs, current, failed); 292 293 /* 294 * Clear the MSR VSX bit to indicate there is no valid state attached 295 * to this context, except in the specific case below where we set it. 296 */ 297 msr &= ~MSR_VSX; 298 #ifdef CONFIG_VSX 299 /* 300 * Copy VSR 0-31 upper half from thread_struct to local 301 * buffer, then write that to userspace. Also set MSR_VSX in 302 * the saved MSR value to indicate that frame->mc_vregs 303 * contains valid data 304 */ 305 if (current->thread.used_vsr && ctx_has_vsx_region) { 306 unsafe_copy_vsx_to_user(&frame->mc_vsregs, current, failed); 307 msr |= MSR_VSX; 308 } 309 #endif /* CONFIG_VSX */ 310 #ifdef CONFIG_SPE 311 /* save spe registers */ 312 if (current->thread.used_spe) { > 313 unsafe_copy_to_user(&frame->mc_vregs, current->thread.evr, > 314 ELF_NEVRREG * sizeof(u32)), failed); 315 /* set MSR_SPE in the saved MSR value to indicate that 316 frame->mc_vregs contains valid data */ 317 msr |= MSR_SPE; 318 } 319 /* else assert((regs->msr & MSR_SPE) == 0) */ 320 321 /* We always copy to/from spefscr */ 322 unsafe_put_user(current->thread.spefscr, 323 (u32 __user *)&frame->mc_vregs + ELF_NEVRREG, failed); 324 #endif /* CONFIG_SPE */ 325 326 unsafe_put_user(msr, &frame->mc_gregs[PT_MSR], failed); 327 328 /* We need to write 0 the MSR top 32 bits in the tm frame so that we 329 * can check it on the restore to see if TM is active 330 */ 331 if (tm_frame) 332 unsafe_put_user(0, &tm_frame->mc_gregs[PT_MSR], failed); 333 334 return 0; 335 336 failed: 337 return 1; 338 } 339 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org