All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Hou Wenlong <houwenlong.hwl@antgroup.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [peterz-queue:x86/urgent 2/2] arch/x86/kernel/traps.c:400:14: warning: no previous prototype for 'handle_bug'
Date: Tue, 13 Jan 2026 03:29:45 +0800	[thread overview]
Message-ID: <202601130348.XDX2GfU6-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/urgent
head:   695d896472d6543523de43110b0016b8b4469643
commit: 695d896472d6543523de43110b0016b8b4469643 [2/2] x86_64/bug: Handle __WARN_printf() trap in early_fixup_exception()
config: i386-buildonly-randconfig-001-20260113 (https://download.01.org/0day-ci/archive/20260113/202601130348.XDX2GfU6-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/202601130348.XDX2GfU6-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601130348.XDX2GfU6-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/traps.c:400:14: warning: no previous prototype for 'handle_bug' [-Wmissing-prototypes]
     400 | noinstr bool handle_bug(struct pt_regs *regs)
         |              ^~~~~~~~~~


vim +/handle_bug +400 arch/x86/kernel/traps.c

   399	
 > 400	noinstr bool handle_bug(struct pt_regs *regs)
   401	{
   402		unsigned long addr = regs->ip;
   403		bool handled = false;
   404		int ud_type, ud_len;
   405		s32 ud_imm;
   406	
   407		ud_type = decode_bug(addr, &ud_imm, &ud_len);
   408		if (ud_type == BUG_NONE)
   409			return handled;
   410	
   411		/*
   412		 * All lies, just get the WARN/BUG out.
   413		 */
   414		instrumentation_begin();
   415		/*
   416		 * Normally @regs are unpoisoned by irqentry_enter(), but handle_bug()
   417		 * is a rare case that uses @regs without passing them to
   418		 * irqentry_enter().
   419		 */
   420		kmsan_unpoison_entry_regs(regs);
   421		/*
   422		 * Since we're emulating a CALL with exceptions, restore the interrupt
   423		 * state to what it was at the exception site.
   424		 */
   425		if (regs->flags & X86_EFLAGS_IF)
   426			raw_local_irq_enable();
   427	
   428		switch (ud_type) {
   429		case BUG_UD1_WARN:
   430			if (report_bug_entry((void *)pt_regs_val(regs, ud_imm), regs) == BUG_TRAP_TYPE_WARN)
   431				handled = true;
   432			break;
   433	
   434		case BUG_UD2:
   435			if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN) {
   436				handled = true;
   437				break;
   438			}
   439			fallthrough;
   440	
   441		case BUG_UDB:
   442		case BUG_LOCK:
   443			if (handle_cfi_failure(regs) == BUG_TRAP_TYPE_WARN) {
   444				handled = true;
   445				break;
   446			}
   447			break;
   448	
   449		case BUG_UD1_UBSAN:
   450			if (IS_ENABLED(CONFIG_UBSAN_TRAP)) {
   451				pr_crit("%s at %pS\n",
   452					report_ubsan_failure(ud_imm),
   453					(void *)regs->ip);
   454			}
   455			break;
   456	
   457		default:
   458			break;
   459		}
   460	
   461		/*
   462		 * When continuing, and regs->ip hasn't changed, move it to the next
   463		 * instruction. When not continuing execution, restore the instruction
   464		 * pointer.
   465		 */
   466		if (handled) {
   467			if (regs->ip == addr)
   468				regs->ip += ud_len;
   469		} else {
   470			regs->ip = addr;
   471		}
   472	
   473		if (regs->flags & X86_EFLAGS_IF)
   474			raw_local_irq_disable();
   475		instrumentation_end();
   476	
   477		return handled;
   478	}
   479	

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

                 reply	other threads:[~2026-01-12 19:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202601130348.XDX2GfU6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=houwenlong.hwl@antgroup.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.