All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [kas:sdei-nmi/diag-cpuoff-direct 5/5] arch/arm64/kernel/smp.c:893:14: warning: unused variable 'crash'
Date: Tue, 30 Jun 2026 10:28:23 +0800	[thread overview]
Message-ID: <202606301044.xcGHJhez-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git sdei-nmi/diag-cpuoff-direct
head:   256121e44ded1ba35c2d5a495426fdc4f18440be
commit: 256121e44ded1ba35c2d5a495426fdc4f18440be [5/5] DIAG: call CPU_OFF directly from the SDEI handler (do not submit)
config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20260630/202606301044.xcGHJhez-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260630/202606301044.xcGHJhez-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/202606301044.xcGHJhez-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/arm64/kernel/smp.c: In function 'arm64_nmi_cpu_stop':
>> arch/arm64/kernel/smp.c:893:14: warning: unused variable 'crash' [-Wunused-variable]
     893 |         bool crash = IS_ENABLED(CONFIG_KEXEC_CORE) && crash_stop;
         |              ^~~~~


vim +/crash +893 arch/arm64/kernel/smp.c

45ed695ac10a23 Nicolas Pitre          2014-07-25  865  
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  866) /**
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  867)  * arm64_nmi_cpu_stop() - stop the local CPU after it is told to stop.
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  868)  * @regs: register state to record in the vmcore on a crash stop, or NULL for
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  869)  *        panic_smp_self_stop(), which has no interrupted context to save.
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  870)  * @die_on_crash: on the kdump crash path, power the CPU off via PSCI CPU_OFF
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  871)  *                (so a capture kernel can reclaim it) rather than parking it.
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  872)  *
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  873)  * The single point every arm64 stop path funnels through, keeping the
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  874)  * bookkeeping (mask interrupts, save the crash context, mark offline, mask
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  875)  * SDEI, optionally power off) in one place:
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  876)  *
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  877)  *   - the regular IPI_CPU_STOP and pseudo-NMI IPI_CPU_STOP_NMI handlers;
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  878)  *   - panic_smp_self_stop(), a CPU parking itself on a parallel panic();
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  879)  *   - the SDEI cross-CPU NMI handler (drivers/firmware/arm_sdei_nmi.c),
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  880)  *     which reaches CPUs the stop IPIs could not.
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  881)  *
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  882)  * The IPI stop handlers pass @die_on_crash true. The SDEI handler and
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  883)  * panic_smp_self_stop() pass false and only park. For SDEI that is required,
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  884)  * not just conservative: it runs inside an SDEI event that is deliberately
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  885)  * never completed (completing it has firmware resume the wedged context), and
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  886)  * a CPU_OFF from that not-yet-completed context wedges EL3 on some firmware --
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  887)  * a documented follow-up. Parking also matches this path's own fallback when
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  888)  * CPU_OFF is unavailable.
d914d4d4974529 Aaro Koskinen          2019-06-17  889   */
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  890) void __noreturn arm64_nmi_cpu_stop(struct pt_regs *regs, bool die_on_crash)
d914d4d4974529 Aaro Koskinen          2019-06-17  891  {
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  892) 	unsigned int cpu = smp_processor_id();
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02 @893) 	bool crash = IS_ENABLED(CONFIG_KEXEC_CORE) && crash_stop;
08e875c16a16c9 Catalin Marinas        2012-03-05  894  
fdfa588124b635 Douglas Anderson       2024-08-21  895  	/*
fdfa588124b635 Douglas Anderson       2024-08-21  896  	 * Use local_daif_mask() instead of local_irq_disable() to make sure
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  897) 	 * that pseudo-NMIs are disabled. The "stop" code starts with an IRQ
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  898) 	 * and falls back to NMI (which might be pseudo). If the IRQ finally
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  899) 	 * goes through right as we're timing out then the NMI could interrupt
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  900) 	 * us. It's better to prevent the NMI and let the IRQ finish since the
3032112bb2ab2d Kiryl Shutsemau (Meta  2026-06-02  901) 	 * pt_regs will be better.
fdfa588124b635 Douglas Anderson       2024-08-21  902  	 */
fdfa588124b635 Douglas Anderson       2024-08-21  903  	local_daif_mask();
fdfa588124b635 Douglas Anderson       2024-08-21  904  

:::::: The code at line 893 was first introduced by commit
:::::: 3032112bb2ab2d5149f2d38b97f85caf3a8bb757 arm64: escalate smp_send_stop() to an SDEI NMI as a last resort

:::::: TO: Kiryl Shutsemau (Meta) <kas@kernel.org>
:::::: CC: Kiryl Shutsemau (Meta) <kas@kernel.org>

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

                 reply	other threads:[~2026-06-30  2:28 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=202606301044.xcGHJhez-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kas@kernel.org \
    --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.