Skip to contentSkip to conversation

arch/x86/entry/common.c:211: warning: Function parameter or struct member 'regs' not described in 'do_int80_emulation'

DISCUSSION kernel test robot 1 participant 1 message Dec 13, 2024

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

Hi Pawan,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   eefa7a9c069908412f8f5d15833901d1b46ae1b2
commit: 7390db8aea0d64e9deb28b8e1ce716f5020c7ee5 x86/bhi: Add support for clearing branch history at syscall entry
date:   8 months ago
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20241213/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241213/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> arch/x86/entry/common.c:211: warning: Function parameter or struct member 'regs' not described in 'do_int80_emulation'

vim +211 arch/x86/entry/common.c

55617fb991df535 Thomas Gleixner 2023-12-04  190  
be5341eb0d43b1e Thomas Gleixner 2023-12-04  191  /**
7390db8aea0d64e Pawan Gupta     2024-03-11  192   * do_int80_emulation - 32-bit legacy syscall C entry from asm
be5341eb0d43b1e Thomas Gleixner 2023-12-04  193   *
be5341eb0d43b1e Thomas Gleixner 2023-12-04  194   * This entry point can be used by 32-bit and 64-bit programs to perform
be5341eb0d43b1e Thomas Gleixner 2023-12-04  195   * 32-bit system calls.  Instances of INT $0x80 can be found inline in
be5341eb0d43b1e Thomas Gleixner 2023-12-04  196   * various programs and libraries.  It is also used by the vDSO's
be5341eb0d43b1e Thomas Gleixner 2023-12-04  197   * __kernel_vsyscall fallback for hardware that doesn't support a faster
be5341eb0d43b1e Thomas Gleixner 2023-12-04  198   * entry method.  Restarted 32-bit system calls also fall back to INT
be5341eb0d43b1e Thomas Gleixner 2023-12-04  199   * $0x80 regardless of what instruction was originally used to do the
be5341eb0d43b1e Thomas Gleixner 2023-12-04  200   * system call.
be5341eb0d43b1e Thomas Gleixner 2023-12-04  201   *
be5341eb0d43b1e Thomas Gleixner 2023-12-04  202   * This is considered a slow path.  It is not used by most libc
be5341eb0d43b1e Thomas Gleixner 2023-12-04  203   * implementations on modern hardware except during process startup.
be5341eb0d43b1e Thomas Gleixner 2023-12-04  204   *
be5341eb0d43b1e Thomas Gleixner 2023-12-04  205   * The arguments for the INT $0x80 based syscall are on stack in the
be5341eb0d43b1e Thomas Gleixner 2023-12-04  206   * pt_regs structure:
be5341eb0d43b1e Thomas Gleixner 2023-12-04  207   *   eax:				system call number
be5341eb0d43b1e Thomas Gleixner 2023-12-04  208   *   ebx, ecx, edx, esi, edi, ebp:	arg1 - arg 6
be5341eb0d43b1e Thomas Gleixner 2023-12-04  209   */
7390db8aea0d64e Pawan Gupta     2024-03-11  210  __visible noinstr void do_int80_emulation(struct pt_regs *regs)
be5341eb0d43b1e Thomas Gleixner 2023-12-04 @211  {
be5341eb0d43b1e Thomas Gleixner 2023-12-04  212  	int nr;
be5341eb0d43b1e Thomas Gleixner 2023-12-04  213  
55617fb991df535 Thomas Gleixner 2023-12-04  214  	/* Kernel does not use INT $0x80! */
55617fb991df535 Thomas Gleixner 2023-12-04  215  	if (unlikely(!user_mode(regs))) {
55617fb991df535 Thomas Gleixner 2023-12-04  216  		irqentry_enter(regs);
55617fb991df535 Thomas Gleixner 2023-12-04  217  		instrumentation_begin();
55617fb991df535 Thomas Gleixner 2023-12-04  218  		panic("Unexpected external interrupt 0x80\n");
55617fb991df535 Thomas Gleixner 2023-12-04  219  	}
55617fb991df535 Thomas Gleixner 2023-12-04  220  
55617fb991df535 Thomas Gleixner 2023-12-04  221  	/*
55617fb991df535 Thomas Gleixner 2023-12-04  222  	 * Establish kernel context for instrumentation, including for
55617fb991df535 Thomas Gleixner 2023-12-04  223  	 * int80_is_external() below which calls into the APIC driver.
55617fb991df535 Thomas Gleixner 2023-12-04  224  	 * Identical for soft and external interrupts.
55617fb991df535 Thomas Gleixner 2023-12-04  225  	 */
be5341eb0d43b1e Thomas Gleixner 2023-12-04  226  	enter_from_user_mode(regs);
be5341eb0d43b1e Thomas Gleixner 2023-12-04  227  
be5341eb0d43b1e Thomas Gleixner 2023-12-04  228  	instrumentation_begin();
be5341eb0d43b1e Thomas Gleixner 2023-12-04  229  	add_random_kstack_offset();
be5341eb0d43b1e Thomas Gleixner 2023-12-04  230  
55617fb991df535 Thomas Gleixner 2023-12-04  231  	/* Validate that this is a soft interrupt to the extent possible */
55617fb991df535 Thomas Gleixner 2023-12-04  232  	if (unlikely(int80_is_external()))
55617fb991df535 Thomas Gleixner 2023-12-04  233  		panic("Unexpected external interrupt 0x80\n");
55617fb991df535 Thomas Gleixner 2023-12-04  234  
be5341eb0d43b1e Thomas Gleixner 2023-12-04  235  	/*
be5341eb0d43b1e Thomas Gleixner 2023-12-04  236  	 * The low level idtentry code pushed -1 into regs::orig_ax
be5341eb0d43b1e Thomas Gleixner 2023-12-04  237  	 * and regs::ax contains the syscall number.
be5341eb0d43b1e Thomas Gleixner 2023-12-04  238  	 *
be5341eb0d43b1e Thomas Gleixner 2023-12-04  239  	 * User tracing code (ptrace or signal handlers) might assume
be5341eb0d43b1e Thomas Gleixner 2023-12-04  240  	 * that the regs::orig_ax contains a 32-bit number on invoking
be5341eb0d43b1e Thomas Gleixner 2023-12-04  241  	 * a 32-bit syscall.
be5341eb0d43b1e Thomas Gleixner 2023-12-04  242  	 *
be5341eb0d43b1e Thomas Gleixner 2023-12-04  243  	 * Establish the syscall convention by saving the 32bit truncated
be5341eb0d43b1e Thomas Gleixner 2023-12-04  244  	 * syscall number in regs::orig_ax and by invalidating regs::ax.
be5341eb0d43b1e Thomas Gleixner 2023-12-04  245  	 */
be5341eb0d43b1e Thomas Gleixner 2023-12-04  246  	regs->orig_ax = regs->ax & GENMASK(31, 0);
be5341eb0d43b1e Thomas Gleixner 2023-12-04  247  	regs->ax = -ENOSYS;
be5341eb0d43b1e Thomas Gleixner 2023-12-04  248  
be5341eb0d43b1e Thomas Gleixner 2023-12-04  249  	nr = syscall_32_enter(regs);
be5341eb0d43b1e Thomas Gleixner 2023-12-04  250  
be5341eb0d43b1e Thomas Gleixner 2023-12-04  251  	local_irq_enable();
be5341eb0d43b1e Thomas Gleixner 2023-12-04  252  	nr = syscall_enter_from_user_mode_work(regs, nr);
be5341eb0d43b1e Thomas Gleixner 2023-12-04  253  	do_syscall_32_irqs_on(regs, nr);
be5341eb0d43b1e Thomas Gleixner 2023-12-04  254  
be5341eb0d43b1e Thomas Gleixner 2023-12-04  255  	instrumentation_end();
be5341eb0d43b1e Thomas Gleixner 2023-12-04  256  	syscall_exit_to_user_mode(regs);
be5341eb0d43b1e Thomas Gleixner 2023-12-04  257  }
be5341eb0d43b1e Thomas Gleixner 2023-12-04  258  #else /* CONFIG_IA32_EMULATION */
be5341eb0d43b1e Thomas Gleixner 2023-12-04  259  

:::::: The code at line 211 was first introduced by commit
:::::: be5341eb0d43b1e754799498bd2e8756cc167a41 x86/entry: Convert INT 0x80 emulation to IDTENTRY

:::::: TO: Thomas Gleixner <[email protected]> :::::: CC: Dave Hansen <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki