[riscv:for-next 18/20] arch/riscv/kernel/signal.c:197:28: error: use of undeclared identifier '__vdso_rt_sigreturn_offset'
From: kernel test robot
Date: Thu Aug 26 2021 - 05:50:23 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next
head: a290f510a178830a01bfc06e66a54bbe4ece5d2a
commit: fde9c59aebafb91caeed816cc510b56f14aa63ae [18/20] riscv: explicitly use symbol offsets for VDSO
config: riscv-randconfig-r042-20210826 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ea08c4cd1c0869ec5024a8bb3f5cdf06ab03ae83)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?id=fde9c59aebafb91caeed816cc510b56f14aa63ae
git remote add riscv https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
git fetch --no-tags riscv for-next
git checkout fde9c59aebafb91caeed816cc510b56f14aa63ae
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/kernel/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
>> arch/riscv/kernel/signal.c:197:28: error: use of undeclared identifier '__vdso_rt_sigreturn_offset'
regs->ra = (unsigned long)VDSO_SYMBOL(
^
arch/riscv/include/asm/vdso.h:20:42: note: expanded from macro 'VDSO_SYMBOL'
(void __user *)((unsigned long)(base) + __vdso_##name##_offset)
^
<scratch space>:183:1: note: expanded from here
__vdso_rt_sigreturn_offset
^
arch/riscv/kernel/signal.c:309:27: warning: no previous prototype for function 'do_notify_resume' [-Wmissing-prototypes]
asmlinkage __visible void do_notify_resume(struct pt_regs *regs,
^
arch/riscv/kernel/signal.c:309:22: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage __visible void do_notify_resume(struct pt_regs *regs,
^
static
1 warning and 1 error generated.
--
ld.lld: error: section .text load address range overlaps with .eh_frame_hdr
>>> .text range is [0x800, 0xE93]
>>> .eh_frame_hdr range is [0x9C0, 0x9E3]
>> llvm-nm: error: arch/riscv/kernel/vdso/vdso.so.dbg: No such file or directory
vim +/__vdso_rt_sigreturn_offset +197 arch/riscv/kernel/signal.c
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 173
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 174 static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 175 struct pt_regs *regs)
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 176 {
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 177 struct rt_sigframe __user *frame;
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 178 long err = 0;
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 179
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 180 frame = get_sigframe(ksig, regs, sizeof(*frame));
96d4f267e40f95 Linus Torvalds 2019-01-03 181 if (!access_ok(frame, sizeof(*frame)))
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 182 return -EFAULT;
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 183
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 184 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 185
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 186 /* Create the ucontext. */
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 187 err |= __put_user(0, &frame->uc.uc_flags);
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 188 err |= __put_user(NULL, &frame->uc.uc_link);
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 189 err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 190 err |= setup_sigcontext(frame, regs);
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 191 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 192 if (err)
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 193 return -EFAULT;
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 194
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 195 /* Set up to return from userspace. */
6bd33e1ece528f Christoph Hellwig 2019-10-28 196 #ifdef CONFIG_MMU
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 @197 regs->ra = (unsigned long)VDSO_SYMBOL(
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 198 current->mm->context.vdso, rt_sigreturn);
6bd33e1ece528f Christoph Hellwig 2019-10-28 199 #else
6bd33e1ece528f Christoph Hellwig 2019-10-28 200 /*
6bd33e1ece528f Christoph Hellwig 2019-10-28 201 * For the nommu case we don't have a VDSO. Instead we push two
6bd33e1ece528f Christoph Hellwig 2019-10-28 202 * instructions to call the rt_sigreturn syscall onto the user stack.
6bd33e1ece528f Christoph Hellwig 2019-10-28 203 */
6bd33e1ece528f Christoph Hellwig 2019-10-28 204 if (copy_to_user(&frame->sigreturn_code, __user_rt_sigreturn,
6bd33e1ece528f Christoph Hellwig 2019-10-28 205 sizeof(frame->sigreturn_code)))
6bd33e1ece528f Christoph Hellwig 2019-10-28 206 return -EFAULT;
6bd33e1ece528f Christoph Hellwig 2019-10-28 207 regs->ra = (unsigned long)&frame->sigreturn_code;
6bd33e1ece528f Christoph Hellwig 2019-10-28 208 #endif /* CONFIG_MMU */
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 209
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 210 /*
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 211 * Set up registers for signal handler.
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 212 * Registers that we don't modify keep the value they had from
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 213 * user-space at the time we took the signal.
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 214 * We always pass siginfo and mcontext, regardless of SA_SIGINFO,
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 215 * since some things rely on this (e.g. glibc's debug/segfault.c).
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 216 */
a4c3733d32a72f Christoph Hellwig 2019-10-28 217 regs->epc = (unsigned long)ksig->ka.sa.sa_handler;
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 218 regs->sp = (unsigned long)frame;
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 219 regs->a0 = ksig->sig; /* a0: signal number */
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 220 regs->a1 = (unsigned long)(&frame->info); /* a1: siginfo pointer */
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 221 regs->a2 = (unsigned long)(&frame->uc); /* a2: ucontext pointer */
e2c0cdfba7f699 Palmer Dabbelt 2017-07-10 222
:::::: The code at line 197 was first introduced by commit
:::::: e2c0cdfba7f69925afc92b20cd9835d81e11a4f1 RISC-V: User-facing API
:::::: TO: Palmer Dabbelt <palmer@xxxxxxxxxxx>
:::::: CC: Palmer Dabbelt <palmer@xxxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip