All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Kaplan <david.kaplan@amd.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH 30/56] x86/nmi: Add support for stop_machine_nmi()
Date: Tue, 14 Oct 2025 15:34:55 +0800	[thread overview]
Message-ID: <202510141529.N8HejZLM-lkp@intel.com> (raw)
In-Reply-To: <20251013143444.3999-31-david.kaplan@amd.com>

Hi David,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on a5652f0f2a69fadcfb2f687a11a737a57f15b28e]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Kaplan/Documentation-admin-guide-Add-documentation/20251013-231516
base:   a5652f0f2a69fadcfb2f687a11a737a57f15b28e
patch link:    https://lore.kernel.org/r/20251013143444.3999-31-david.kaplan%40amd.com
patch subject: [RFC PATCH 30/56] x86/nmi: Add support for stop_machine_nmi()
config: i386-buildonly-randconfig-001-20251014 (https://download.01.org/0day-ci/archive/20251014/202510141529.N8HejZLM-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/20251014/202510141529.N8HejZLM-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/202510141529.N8HejZLM-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/x86/kernel/nmi.c: In function 'default_do_nmi':
>> arch/x86/kernel/nmi.c:385:13: error: implicit declaration of function 'stop_machine_nmi_handler_enabled'; did you mean 'trace_nmi_handler_enabled'? [-Wimplicit-function-declaration]
     385 |         if (stop_machine_nmi_handler_enabled() && stop_machine_nmi_handler())
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |             trace_nmi_handler_enabled
>> arch/x86/kernel/nmi.c:385:51: error: implicit declaration of function 'stop_machine_nmi_handler'; did you mean 'trace_nmi_handler'? [-Wimplicit-function-declaration]
     385 |         if (stop_machine_nmi_handler_enabled() && stop_machine_nmi_handler())
         |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~
         |                                                   trace_nmi_handler


vim +385 arch/x86/kernel/nmi.c

   355	
   356	static noinstr void default_do_nmi(struct pt_regs *regs)
   357	{
   358		unsigned char reason = 0;
   359		int handled;
   360		bool b2b = false;
   361	
   362		/*
   363		 * Back-to-back NMIs are detected by comparing the RIP of the
   364		 * current NMI with that of the previous NMI. If it is the same,
   365		 * it is assumed that the CPU did not have a chance to jump back
   366		 * into a non-NMI context and execute code in between the two
   367		 * NMIs.
   368		 *
   369		 * They are interesting because even if there are more than two,
   370		 * only a maximum of two can be detected (anything over two is
   371		 * dropped due to NMI being edge-triggered). If this is the
   372		 * second half of the back-to-back NMI, assume we dropped things
   373		 * and process more handlers. Otherwise, reset the 'swallow' NMI
   374		 * behavior.
   375		 */
   376		if (regs->ip == __this_cpu_read(last_nmi_rip))
   377			b2b = true;
   378		else
   379			__this_cpu_write(swallow_nmi, false);
   380	
   381		__this_cpu_write(last_nmi_rip, regs->ip);
   382	
   383		instrumentation_begin();
   384	
 > 385		if (stop_machine_nmi_handler_enabled() && stop_machine_nmi_handler())
   386			goto out;
   387	
   388		if (microcode_nmi_handler_enabled() && microcode_nmi_handler())
   389			goto out;
   390	
   391		/*
   392		 * CPU-specific NMI must be processed before non-CPU-specific
   393		 * NMI, otherwise we may lose it, because the CPU-specific
   394		 * NMI can not be detected/processed on other CPUs.
   395		 */
   396		handled = nmi_handle(NMI_LOCAL, regs);
   397		__this_cpu_add(nmi_stats.normal, handled);
   398		if (handled) {
   399			/*
   400			 * There are cases when a NMI handler handles multiple
   401			 * events in the current NMI.  One of these events may
   402			 * be queued for in the next NMI.  Because the event is
   403			 * already handled, the next NMI will result in an unknown
   404			 * NMI.  Instead lets flag this for a potential NMI to
   405			 * swallow.
   406			 */
   407			if (handled > 1)
   408				__this_cpu_write(swallow_nmi, true);
   409			goto out;
   410		}
   411	
   412		/*
   413		 * Non-CPU-specific NMI: NMI sources can be processed on any CPU.
   414		 *
   415		 * Another CPU may be processing panic routines while holding
   416		 * nmi_reason_lock. Check if the CPU issued the IPI for crash dumping,
   417		 * and if so, call its callback directly.  If there is no CPU preparing
   418		 * crash dump, we simply loop here.
   419		 */
   420		while (!raw_spin_trylock(&nmi_reason_lock)) {
   421			run_crash_ipi_callback(regs);
   422			cpu_relax();
   423		}
   424	
   425		reason = x86_platform.get_nmi_reason();
   426	
   427		if (reason & NMI_REASON_MASK) {
   428			if (reason & NMI_REASON_SERR)
   429				pci_serr_error(reason, regs);
   430			else if (reason & NMI_REASON_IOCHK)
   431				io_check_error(reason, regs);
   432	
   433			/*
   434			 * Reassert NMI in case it became active
   435			 * meanwhile as it's edge-triggered:
   436			 */
   437			if (IS_ENABLED(CONFIG_X86_32))
   438				reassert_nmi();
   439	
   440			__this_cpu_add(nmi_stats.external, 1);
   441			raw_spin_unlock(&nmi_reason_lock);
   442			goto out;
   443		}
   444		raw_spin_unlock(&nmi_reason_lock);
   445	
   446		/*
   447		 * Only one NMI can be latched at a time.  To handle
   448		 * this we may process multiple nmi handlers at once to
   449		 * cover the case where an NMI is dropped.  The downside
   450		 * to this approach is we may process an NMI prematurely,
   451		 * while its real NMI is sitting latched.  This will cause
   452		 * an unknown NMI on the next run of the NMI processing.
   453		 *
   454		 * We tried to flag that condition above, by setting the
   455		 * swallow_nmi flag when we process more than one event.
   456		 * This condition is also only present on the second half
   457		 * of a back-to-back NMI, so we flag that condition too.
   458		 *
   459		 * If both are true, we assume we already processed this
   460		 * NMI previously and we swallow it.  Otherwise we reset
   461		 * the logic.
   462		 *
   463		 * There are scenarios where we may accidentally swallow
   464		 * a 'real' unknown NMI.  For example, while processing
   465		 * a perf NMI another perf NMI comes in along with a
   466		 * 'real' unknown NMI.  These two NMIs get combined into
   467		 * one (as described above).  When the next NMI gets
   468		 * processed, it will be flagged by perf as handled, but
   469		 * no one will know that there was a 'real' unknown NMI sent
   470		 * also.  As a result it gets swallowed.  Or if the first
   471		 * perf NMI returns two events handled then the second
   472		 * NMI will get eaten by the logic below, again losing a
   473		 * 'real' unknown NMI.  But this is the best we can do
   474		 * for now.
   475		 */
   476		if (b2b && __this_cpu_read(swallow_nmi))
   477			__this_cpu_add(nmi_stats.swallow, 1);
   478		else
   479			unknown_nmi_error(reason, regs);
   480	
   481	out:
   482		instrumentation_end();
   483	}
   484	

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

  reply	other threads:[~2025-10-14  7:36 UTC|newest]

Thread overview: 178+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13 14:33 [RFC PATCH 00/56] Dynamic mitigations David Kaplan
2025-10-13 14:33 ` [RFC PATCH 01/56] Documentation/admin-guide: Add documentation David Kaplan
2025-10-16 21:24   ` Josh Poimboeuf
2025-10-17 14:04     ` Kaplan, David
2025-10-18 13:39   ` Borislav Petkov
2025-10-20 13:53     ` Kaplan, David
2025-10-22 11:43       ` Borislav Petkov
2025-10-13 14:33 ` [RFC PATCH 02/56] x86/Kconfig: Add CONFIG_DYNAMIC_MITIGATIONS David Kaplan
2025-10-16 21:20   ` Josh Poimboeuf
2025-10-17 13:57     ` Kaplan, David
2025-10-13 14:33 ` [RFC PATCH 03/56] cpu: Reset global mitigations David Kaplan
2025-10-16 21:34   ` Josh Poimboeuf
2025-10-17 14:05     ` Kaplan, David
2025-10-17 14:19       ` Kaplan, David
2025-10-17 16:03         ` Josh Poimboeuf
2025-10-17 16:36           ` Borislav Petkov
2025-10-13 14:33 ` [RFC PATCH 04/56] x86/bugs: Reset spectre_v1 mitigations David Kaplan
2025-10-14 18:37   ` Dave Hansen
2025-10-14 19:16     ` Kaplan, David
2025-10-29 11:57   ` Borislav Petkov
2025-10-29 13:48     ` Kaplan, David
2025-11-03 18:24       ` Borislav Petkov
2025-10-13 14:33 ` [RFC PATCH 05/56] x86/bugs: Reset spectre_v2 mitigations David Kaplan
2025-11-03 19:31   ` Borislav Petkov
2025-11-03 20:10     ` Kaplan, David
2025-11-03 20:28       ` Borislav Petkov
2025-11-05  2:29         ` Josh Poimboeuf
2025-11-05 11:03           ` Borislav Petkov
2025-11-05 17:06             ` Josh Poimboeuf
2025-11-05 20:04               ` Borislav Petkov
2025-11-05 20:21                 ` Kaplan, David
2025-11-05 20:52                   ` Josh Poimboeuf
2025-11-14 17:14                 ` [PATCH] x86/bugs: Get rid of the forward declarations Borislav Petkov
2025-11-14 19:19                   ` Josh Poimboeuf
2025-11-14 19:31                     ` Borislav Petkov
2025-11-14 20:04                   ` Pawan Gupta
2025-10-13 14:33 ` [RFC PATCH 06/56] x86/bugs: Reset retbleed mitigations David Kaplan
2025-10-13 14:33 ` [RFC PATCH 07/56] x86/bugs: Reset spectre_v2_user mitigations David Kaplan
2025-10-16 12:54   ` Brendan Jackman
2025-10-16 14:06     ` Kaplan, David
2025-10-16 14:56       ` Brendan Jackman
2025-10-16 15:26         ` Kaplan, David
2025-10-16 16:13           ` Brendan Jackman
2025-11-26 11:23             ` Borislav Petkov
2025-12-01 16:53               ` Kaplan, David
2025-12-03 12:31                 ` Borislav Petkov
2025-12-03 17:02                   ` Kaplan, David
2025-12-03 17:35                     ` Borislav Petkov
2025-12-03 20:14                       ` Kaplan, David
2025-12-04 15:07                         ` Borislav Petkov
2025-10-13 14:33 ` [RFC PATCH 08/56] x86/bugs: Reset SSB mitigations David Kaplan
2025-10-17 15:13   ` Nikolay Borisov
2025-10-17 15:56     ` Kaplan, David
2026-01-20 13:07   ` Borislav Petkov
2025-10-13 14:33 ` [RFC PATCH 09/56] x86/bugs: Reset L1TF mitigations David Kaplan
2025-10-13 14:33 ` [RFC PATCH 10/56] x86/bugs: Reset MDS mitigations David Kaplan
2025-10-13 14:33 ` [RFC PATCH 11/56] x86/bugs: Reset MMIO mitigations David Kaplan
2026-01-26 13:05   ` Borislav Petkov
2026-01-26 14:51     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 12/56] x86/bugs: Reset SRBDS mitigations David Kaplan
2025-10-13 14:34 ` [RFC PATCH 13/56] x86/bugs: Reset SRSO mitigations David Kaplan
2025-10-13 14:34 ` [RFC PATCH 14/56] x86/bugs: Reset GDS mitigations David Kaplan
2025-10-24  2:40   ` Pawan Gupta
2025-10-24 14:43     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 15/56] x86/bugs: Reset BHI mitigations David Kaplan
2025-10-24  2:49   ` Pawan Gupta
2025-10-24 15:02     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 16/56] x86/bugs: Reset ITS mitigation David Kaplan
2025-10-13 14:34 ` [RFC PATCH 17/56] x86/bugs: Reset TSA mitigations David Kaplan
2025-10-13 14:34 ` [RFC PATCH 18/56] x86/bugs: Reset VMSCAPE mitigations David Kaplan
2025-10-13 14:34 ` [RFC PATCH 19/56] x86/bugs: Define bugs_smt_disable() David Kaplan
2025-10-13 14:34 ` [RFC PATCH 20/56] x86/bugs: Move bugs.c logic out of .init section David Kaplan
2025-10-16 12:31   ` Brendan Jackman
2025-10-16 13:46     ` Kaplan, David
2025-10-16 14:33       ` Brendan Jackman
2025-10-13 14:34 ` [RFC PATCH 21/56] x86/callthunks: Move logic out of .init David Kaplan
2025-10-13 14:34 ` [RFC PATCH 22/56] cpu: Move mitigation " David Kaplan
2025-10-13 14:34 ` [RFC PATCH 23/56] x86/vmlinux.lds: Move alternative sections David Kaplan
2025-10-13 14:34 ` [RFC PATCH 24/56] x86/vmlinux.lds: Move altinstr_aux conditionally David Kaplan
2025-10-13 14:34 ` [RFC PATCH 25/56] x86/vmlinux.lds: Define __init_alt_end David Kaplan
2025-10-13 14:34 ` [RFC PATCH 26/56] module: Save module ELF info David Kaplan
2025-10-13 14:34 ` [RFC PATCH 27/56] x86/mm: Conditionally free alternative sections David Kaplan
2025-10-13 14:34 ` [RFC PATCH 28/56] stop_machine: Add stop_machine_nmi() David Kaplan
2026-01-09 22:16   ` Chang S. Bae
2026-01-09 22:19     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 29/56] x86/apic: Add self-NMI support David Kaplan
2025-10-13 14:34 ` [RFC PATCH 30/56] x86/nmi: Add support for stop_machine_nmi() David Kaplan
2025-10-14  7:34   ` kernel test robot [this message]
2025-10-13 14:34 ` [RFC PATCH 31/56] x86/alternative: Prepend nops with retpolines David Kaplan
2025-10-16 10:32   ` Peter Zijlstra
2025-10-16 11:08     ` Peter Zijlstra
2025-10-16 11:07   ` Peter Zijlstra
2025-10-16 11:10     ` Peter Zijlstra
2025-10-16 11:23     ` Peter Zijlstra
2025-10-16 13:27       ` Kaplan, David
2025-10-16 14:07         ` Peter Zijlstra
2025-10-16 14:16           ` Kaplan, David
2025-10-16 14:23             ` Peter Zijlstra
2025-10-22  8:41         ` David Laight
2025-10-22 10:40           ` Peter Zijlstra
2025-10-13 14:34 ` [RFC PATCH 32/56] x86/alternative: Add module param David Kaplan
2025-10-13 14:34 ` [RFC PATCH 33/56] x86/alternative: Avoid re-patching init code David Kaplan
2025-10-13 14:34 ` [RFC PATCH 34/56] x86/alternative: Save old bytes for alternatives David Kaplan
2025-10-15 10:38   ` Juergen Gross
2025-10-15 13:45     ` Kaplan, David
2025-10-27 11:34       ` Nikolay Borisov
2025-10-27 14:19         ` Kaplan, David
2025-10-29  9:37           ` Nikolay Borisov
2025-10-29 16:26             ` Kaplan, David
2025-10-29 22:14               ` David Laight
2025-10-30 14:39                 ` Kaplan, David
2025-10-30 15:42                   ` Nikolay Borisov
2025-10-30 15:49                     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 35/56] x86/alternative: Save old bytes for retpolines David Kaplan
2025-10-13 14:34 ` [RFC PATCH 36/56] x86/alternative: Do not recompute len on re-patch David Kaplan
2025-10-13 14:34 ` [RFC PATCH 37/56] x86/alternative: Reset alternatives David Kaplan
2025-10-13 14:34 ` [RFC PATCH 38/56] x86/callthunks: Reset callthunks David Kaplan
2025-10-13 14:34 ` [RFC PATCH 39/56] x86/sync_core: Add sync_core_nmi_safe() David Kaplan
2025-10-13 14:34 ` [RFC PATCH 40/56] x86/alternative: Use sync_core_nmi_safe() David Kaplan
2025-10-16 10:35   ` Peter Zijlstra
2025-10-16 14:40     ` Kaplan, David
2025-10-16 14:47       ` Peter Zijlstra
2025-10-16 15:34         ` Kaplan, David
2025-10-16 16:15           ` Dave Hansen
2025-10-16 16:27             ` Borislav Petkov
2025-10-16 18:52           ` Peter Zijlstra
2025-10-16 18:56             ` Kaplan, David
2025-10-16 18:58               ` Peter Zijlstra
2025-10-16 21:53                 ` Andrew Cooper
2025-10-20 14:49         ` Kaplan, David
2025-10-20 15:01           ` Peter Zijlstra
2025-10-23 18:50             ` Kaplan, David
2025-10-23 19:26             ` Andrew Cooper
2025-10-23 21:23             ` David Laight
2025-10-21  2:13           ` H. Peter Anvin
2025-10-13 14:34 ` [RFC PATCH 41/56] static_call: Add update_all_static_calls() David Kaplan
2025-10-14  7:14   ` kernel test robot
2025-10-14  7:45   ` kernel test robot
2025-10-13 14:34 ` [RFC PATCH 42/56] module: Make memory writeable for re-patching David Kaplan
2025-10-13 14:34 ` [RFC PATCH 43/56] module: Update alternatives David Kaplan
2025-10-13 14:34 ` [RFC PATCH 44/56] x86/module: " David Kaplan
2025-10-13 14:34 ` [RFC PATCH 45/56] x86/alternative: Use boot_cpu_has in ITS code David Kaplan
2025-10-13 14:34 ` [RFC PATCH 46/56] x86/alternative: Add ITS re-patching support David Kaplan
2025-10-13 14:34 ` [RFC PATCH 47/56] x86/module: Add ITS re-patch support for modules David Kaplan
2025-10-13 14:34 ` [RFC PATCH 48/56] x86/bugs: Move code for updating speculation MSRs David Kaplan
2025-10-13 14:34 ` [RFC PATCH 49/56] x86/fpu: Qualify warning in os_xsave David Kaplan
2025-10-13 14:34 ` [RFC PATCH 50/56] x86/alternative: Add re-patch support David Kaplan
2025-10-31 10:22   ` Nikolay Borisov
2025-11-04 16:54     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 51/56] cpu: Parse string of mitigation options David Kaplan
2025-10-13 14:34 ` [RFC PATCH 52/56] x86/bugs: Support parsing " David Kaplan
2025-10-27 11:31   ` Nikolay Borisov
2025-10-27 13:56     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 53/56] drivers/cpu: Re-patch mitigations through sysfs David Kaplan
2025-10-27 12:25   ` Nikolay Borisov
2025-10-27 13:59     ` Kaplan, David
2025-10-13 14:34 ` [RFC PATCH 54/56] x86/debug: Create debugfs interface to x86_capabilities David Kaplan
2025-10-13 14:34 ` [RFC PATCH 55/56] x86/debug: Show return thunk in debugfs David Kaplan
2025-10-27 12:29   ` Nikolay Borisov
2025-10-27 14:24     ` David Laight
2025-10-13 14:34 ` [RFC PATCH 56/56] x86/debug: Show static branch config " David Kaplan
2025-10-14 16:29 ` [RFC PATCH 00/56] Dynamic mitigations Josh Poimboeuf
2025-10-14 18:06   ` Kaplan, David
2025-10-15  9:14     ` Alexander Graf
2025-10-15 23:06     ` Boris Ostrovsky
2025-10-16 12:21     ` Brendan Jackman
2025-10-15  4:10 ` Aaron Rainbolt
2025-10-15 13:53   ` Kaplan, David
2025-10-15 15:43     ` Josh Poimboeuf
2025-10-15 15:51       ` Kaplan, David
2025-10-15 16:02         ` Josh Poimboeuf
2025-10-15 16:10           ` Kaplan, David
2025-10-16 10:00             ` Nicolas Bouchinet
2025-10-16 13:42               ` Kaplan, David
2025-10-16 13:55                 ` Nicolas Bouchinet
2025-10-16 13:56                   ` Kaplan, David
2025-10-24  5:00 ` Pawan Gupta
2025-10-24 13:41   ` Kaplan, David

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=202510141529.N8HejZLM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=david.kaplan@amd.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.