Hi Christophe,
FYI, the error/warning still remains.
tree:
https://github.com/linuxppc/linux next-test
head: 3ac6488df9160f52bbd8b8ec3387a53ac3d0f2eb
commit: 627b72bee84d6652e0af26617e71ce2b3c18fcd5 [130/182] powerpc/signal32: Convert
restore_[tm]_user_regs() to user access block
config: powerpc-mpc8540_ads_defconfig (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
#
https://github.com/linuxppc/linux/commit/627b72bee84d6652e0af26617e71ce2b...
git remote add linuxppc
https://github.com/linuxppc/linux
git fetch --no-tags linuxppc next-test
git checkout 627b72bee84d6652e0af26617e71ce2b3c18fcd5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/powerpc/kernel/signal_32.c: In function 'restore_user_regs':
> arch/powerpc/kernel/signal_32.c:573:36: error: macro
"unsafe_copy_from_user" requires 4 arguments, but only 3 given
573 |
ELF_NEVRREG * sizeof(u32));
| ^
In file included from include/linux/uaccess.h:11,
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:707,
from arch/powerpc/kernel/signal_32.c:17:
arch/powerpc/include/asm/uaccess.h:428: note: macro "unsafe_copy_from_user"
defined here
428 | #define unsafe_copy_from_user(d, s, l, e) \
|
> arch/powerpc/kernel/signal_32.c:572:3: error:
'unsafe_copy_from_user' undeclared (first use in this function); did you mean
'raw_copy_from_user'?
572 |
unsafe_copy_from_user(current->thread.evr, &sr->mc_vregs,
| ^~~~~~~~~~~~~~~~~~~~~
| raw_copy_from_user
arch/powerpc/kernel/signal_32.c:572:3: note: each undeclared identifier is reported
only once for each function it appears in
vim +/unsafe_copy_from_user +573 arch/powerpc/kernel/signal_32.c
502
503 if (!user_read_access_begin(sr, sizeof(*sr)))
504 return 1;
505 /*
506 * restore general registers but not including MSR or SOFTE. Also
507 * take care of keeping r2 (TLS) intact if not a signal
508 */
509 if (!sig)
510 save_r2 = (unsigned int)regs->gpr[2];
511 unsafe_restore_general_regs(regs, sr, failed);
512 set_trap_norestart(regs);
513 unsafe_get_user(msr, &sr->mc_gregs[PT_MSR], failed);
514 if (!sig)
515 regs->gpr[2] = (unsigned long) save_r2;
516
517 /* if doing signal return, restore the previous little-endian mode */
518 if (sig)
519 regs->msr = (regs->msr & ~MSR_LE) | (msr & MSR_LE);
520
521 #ifdef CONFIG_ALTIVEC
522 /*
523 * Force the process to reload the altivec registers from
524 * current->thread when it next does altivec instructions
525 */
526 regs->msr &= ~MSR_VEC;
527 if (msr & MSR_VEC) {
528 /* restore altivec registers from the stack */
529 unsafe_copy_from_user(¤t->thread.vr_state, &sr->mc_vregs,
530 sizeof(sr->mc_vregs), failed);
531 current->thread.used_vr = true;
532 } else if (current->thread.used_vr)
533 memset(¤t->thread.vr_state, 0,
534 ELF_NVRREG * sizeof(vector128));
535
536 /* Always get VRSAVE back */
537 unsafe_get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32],
failed);
538 if (cpu_has_feature(CPU_FTR_ALTIVEC))
539 mtspr(SPRN_VRSAVE, current->thread.vrsave);
540 #endif /* CONFIG_ALTIVEC */
541 unsafe_copy_fpr_from_user(current, &sr->mc_fregs, failed);
542
543 #ifdef CONFIG_VSX
544 /*
545 * Force the process to reload the VSX registers from
546 * current->thread when it next does VSX instruction.
547 */
548 regs->msr &= ~MSR_VSX;
549 if (msr & MSR_VSX) {
550 /*
551 * Restore altivec registers from the stack to a local
552 * buffer, then write this out to the thread_struct
553 */
554 unsafe_copy_vsx_from_user(current, &sr->mc_vsregs, failed);
555 current->thread.used_vsr = true;
556 } else if (current->thread.used_vsr)
557 for (i = 0; i < 32 ; i++)
558 current->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = 0;
559 #endif /* CONFIG_VSX */
560 /*
561 * force the process to reload the FP registers from
562 * current->thread when it next does FP instructions
563 */
564 regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
565
566 #ifdef CONFIG_SPE
567 /* force the process to reload the spe registers from
568 current->thread when it next does spe instructions */
569 regs->msr &= ~MSR_SPE;
570 if (msr & MSR_SPE) {
571 /* restore spe registers from the stack */
572 unsafe_copy_from_user(current->thread.evr,
&sr->mc_vregs,
573 ELF_NEVRREG * sizeof(u32));
574 current->thread.used_spe =
true;
575 } else if (current->thread.used_spe)
576 memset(current->thread.evr, 0, ELF_NEVRREG * sizeof(u32));
577
578 /* Always get SPEFSCR back */
579 unsafe_get_user(current->thread.spefscr, (u32 __user *)&sr->mc_vregs +
ELF_NEVRREG, failed);
580 #endif /* CONFIG_SPE */
581
582 user_read_access_end();
583 return 0;
584
585 failed:
586 user_read_access_end();
587 return 1;
588 }
589
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org