[peterz-queue:x86/core 1/3] arch/x86/kernel/traps.c:531:6: warning: no previous prototype for function 'fixup_iopl_exception'

From: kernel test robot
Date: Fri Sep 17 2021 - 14:36:33 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/core
head: e1250da5c3b4148363ccfd7cf40da08df3a0ef86
commit: 61e9638f4e4429e57b6ae2c886261695d5cdac51 [1/3] x86/iopl: Fake iopl(3) CLI/STI usage
config: i386-randconfig-r035-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c8b3d7d6d6de37af68b2f379d0e37304f78e115f)
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://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=61e9638f4e4429e57b6ae2c886261695d5cdac51
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/core
git checkout 61e9638f4e4429e57b6ae2c886261695d5cdac51
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/traps.c:531:6: warning: no previous prototype for function 'fixup_iopl_exception' [-Wmissing-prototypes]
bool fixup_iopl_exception(struct pt_regs *regs)
^
arch/x86/kernel/traps.c:531:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool fixup_iopl_exception(struct pt_regs *regs)
^
static
1 warning generated.


vim +/fixup_iopl_exception +531 arch/x86/kernel/traps.c

530
> 531 bool fixup_iopl_exception(struct pt_regs *regs)
532 {
533 struct thread_struct *t = &current->thread;
534 unsigned char buf[MAX_INSN_SIZE];
535 struct insn insn;
536 int nr_copied;
537
538 if (!IS_ENABLED(CONFIG_X86_IOPL_IOPERM) || t->iopl_emul != 3 || !regs)
539 return false;
540
541 nr_copied = insn_fetch_from_user(regs, buf);
542 if (nr_copied <= 0)
543 return false;
544
545 if (!insn_decode_from_regs(&insn, regs, buf, nr_copied))
546 return false;
547
548 if (insn.length != 1)
549 return false;
550
551 if (insn.opcode.bytes[0] != 0xfa &&
552 insn.opcode.bytes[0] != 0xfb)
553 return false;
554
555 if (!t->iopl_warn && printk_ratelimit()) {
556 pr_err("%s[%d] attempts to use CLI/STI, pretending it's a NOP, ip:%lx",
557 current->comm, task_pid_nr(current), regs->ip);
558 print_vma_addr(KERN_CONT " in ", regs->ip);
559 pr_cont("\n");
560 t->iopl_warn = 1;
561 }
562
563 regs->ip += 1;
564 return true;
565 }
566

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

Attachment: .config.gz
Description: application/gzip