[luto:x86/no_sce 2/2] arch/x86/kernel/traps.c:273:3: error: implicit declaration of function 'do_syscall_64'; did you mean 'NR_syscalls'?

From: kernel test robot
Date: Wed Sep 29 2021 - 17:00:27 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/no_sce
head: bfaecaf0dad8f61e80285125f4895c9737e3d6d8
commit: bfaecaf0dad8f61e80285125f4895c9737e3d6d8 [2/2] [EVIL] Run with EFER.SCE = 0
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?id=bfaecaf0dad8f61e80285125f4895c9737e3d6d8
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/no_sce
git checkout bfaecaf0dad8f61e80285125f4895c9737e3d6d8
# save the attached .config to linux build tree
make W=1 ARCH=i386

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/x86/kernel/traps.c: In function 'exc_invalid_op':
>> arch/x86/kernel/traps.c:273:3: error: implicit declaration of function 'do_syscall_64'; did you mean 'NR_syscalls'? [-Werror=implicit-function-declaration]
273 | do_syscall_64(regs->ax, regs);
| ^~~~~~~~~~~~~
| NR_syscalls
cc1: some warnings being treated as errors


vim +273 arch/x86/kernel/traps.c

250
251 DEFINE_IDTENTRY_RAW(exc_invalid_op)
252 {
253 irqentry_state_t state;
254
255 /*
256 * We use UD2 as a short encoding for 'CALL __WARN', as such
257 * handle it before exception entry to avoid recursive WARN
258 * in case exception entry is the one triggering WARNs.
259 */
260 if (!user_mode(regs) && handle_bug(regs))
261 return;
262
263 if (user_mode(regs)) {
264 /*
265 * emulate SYSCALL. I have no idea why ax is a separate
266 * argument. it's probably my fault.
267 *
268 * Don't think too hard about the entry mess here.
269 * This needs to be cleaned up so that syscalls can
270 * be cleanly executed from "irqentry" context.
271 */
272 regs->ip += 2; /* world's best emulator */
> 273 do_syscall_64(regs->ax, regs);
274 return;
275 }
276
277 state = irqentry_enter(regs);
278 instrumentation_begin();
279 handle_invalid_op(regs);
280 instrumentation_end();
281 irqentry_exit(regs, state);
282 }
283

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip