All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-linux-intel-lts:4.19/android_r 19120/20689] arch/x86/kernel/smp.c:273:1: sparse: sparse: unused label 'finish'
@ 2020-12-11 15:46 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-12-11 15:46 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 8829 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Alistair Delva <adelva@google.com>
CC: "Pan, Kris" <kris.pan@intel.com>

tree:   https://github.com/intel/linux-intel-lts.git 4.19/android_r
head:   4a6aef8d991e7c47e5da39927e0ad28ec90cd01b
commit: b652a52d36a85d1b731921ba08e701d7150ce200 [19120/20689] Merge branch 'aosp/android-4.19-stable' into android_r
:::::: branch date: 31 hours ago
:::::: commit date: 4 months ago
config: i386-randconfig-s001-20201209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-179-ga00755aa-dirty
        # https://github.com/intel/linux-intel-lts/commit/b652a52d36a85d1b731921ba08e701d7150ce200
        git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
        git fetch --no-tags intel-linux-intel-lts 4.19/android_r
        git checkout b652a52d36a85d1b731921ba08e701d7150ce200
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> arch/x86/kernel/smp.c:273:1: sparse: sparse: unused label 'finish'
   arch/x86/kernel/smp.c:190:16: warning: no previous prototype for 'smp_reboot_interrupt' [-Wmissing-prototypes]
     190 | __visible void smp_reboot_interrupt(struct pt_regs *regs)
         |                ^~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/smp.c: In function 'native_stop_other_cpus':
   arch/x86/kernel/smp.c:273:1: warning: label 'finish' defined but not used [-Wunused-label]
     273 | finish:
         | ^~~~~~
   arch/x86/kernel/smp.c: At top level:
   arch/x86/kernel/smp.c:285:28: warning: no previous prototype for 'smp_reschedule_interrupt' [-Wmissing-prototypes]
     285 | __visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/smp.c:306:28: warning: no previous prototype for 'smp_call_function_interrupt' [-Wmissing-prototypes]
     306 | __visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/smp.c:316:28: warning: no previous prototype for 'smp_call_function_single_interrupt' [-Wmissing-prototypes]
     316 | __visible void __irq_entry smp_call_function_single_interrupt(struct pt_regs *r)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/finish +273 arch/x86/kernel/smp.c

ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  204  
5d2b86d90f7cc4 Don Zickus     2012-05-11  205  static void native_stop_other_cpus(int wait)
f9e47a126be2ea Glauber Costa  2008-03-03  206  {
f9e47a126be2ea Glauber Costa  2008-03-03  207  	unsigned long flags;
76fac077db6b34 Alok Kataria   2010-10-11  208  	unsigned long timeout;
f9e47a126be2ea Glauber Costa  2008-03-03  209  
f9e47a126be2ea Glauber Costa  2008-03-03  210  	if (reboot_force)
f9e47a126be2ea Glauber Costa  2008-03-03  211  		return;
f9e47a126be2ea Glauber Costa  2008-03-03  212  
4ef702c10b5df1 Andi Kleen     2009-05-27  213  	/*
4ef702c10b5df1 Andi Kleen     2009-05-27  214  	 * Use an own vector here because smp_call_function
4ef702c10b5df1 Andi Kleen     2009-05-27  215  	 * does lots of things not suitable in a panic situation.
7d007d21e539db Don Zickus     2012-05-11  216  	 */
7d007d21e539db Don Zickus     2012-05-11  217  
7d007d21e539db Don Zickus     2012-05-11  218  	/*
7d007d21e539db Don Zickus     2012-05-11  219  	 * We start by using the REBOOT_VECTOR irq.
7d007d21e539db Don Zickus     2012-05-11  220  	 * The irq is treated as a sync point to allow critical
7d007d21e539db Don Zickus     2012-05-11  221  	 * regions of code on other cpus to release their spin locks
7d007d21e539db Don Zickus     2012-05-11  222  	 * and re-enable irqs.  Jumping straight to an NMI might
7d007d21e539db Don Zickus     2012-05-11  223  	 * accidentally cause deadlocks with further shutdown/panic
7d007d21e539db Don Zickus     2012-05-11  224  	 * code.  By syncing, we give the cpus up to one second to
7d007d21e539db Don Zickus     2012-05-11  225  	 * finish their work before we force them off with the NMI.
4ef702c10b5df1 Andi Kleen     2009-05-27  226  	 */
4ef702c10b5df1 Andi Kleen     2009-05-27  227  	if (num_online_cpus() > 1) {
7d007d21e539db Don Zickus     2012-05-11  228  		/* did someone beat us here? */
7d007d21e539db Don Zickus     2012-05-11  229  		if (atomic_cmpxchg(&stopping_cpu, -1, safe_smp_processor_id()) != -1)
7d007d21e539db Don Zickus     2012-05-11  230  			return;
7d007d21e539db Don Zickus     2012-05-11  231  
7d007d21e539db Don Zickus     2012-05-11  232  		/* sync above data before sending IRQ */
7d007d21e539db Don Zickus     2012-05-11  233  		wmb();
7d007d21e539db Don Zickus     2012-05-11  234  
4ef702c10b5df1 Andi Kleen     2009-05-27  235  		apic->send_IPI_allbutself(REBOOT_VECTOR);
4ef702c10b5df1 Andi Kleen     2009-05-27  236  
76fac077db6b34 Alok Kataria   2010-10-11  237  		/*
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  238  		 * Don't wait longer than a second for IPI completion. The
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  239  		 * wait request is not checked here because that would
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  240  		 * prevent an NMI shutdown attempt in case that not all
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  241  		 * CPUs reach shutdown state.
76fac077db6b34 Alok Kataria   2010-10-11  242  		 */
76fac077db6b34 Alok Kataria   2010-10-11  243  		timeout = USEC_PER_SEC;
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  244  		while (num_online_cpus() > 1 && timeout--)
4ef702c10b5df1 Andi Kleen     2009-05-27  245  			udelay(1);
4ef702c10b5df1 Andi Kleen     2009-05-27  246  	}
4ef702c10b5df1 Andi Kleen     2009-05-27  247  
7d007d21e539db Don Zickus     2012-05-11  248  	/* if the REBOOT_VECTOR didn't work, try with the NMI */
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  249  	if (num_online_cpus() > 1) {
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  250  		/*
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  251  		 * If NMI IPI is enabled, try to register the stop handler
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  252  		 * and send the IPI. In any case try to wait for the other
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  253  		 * CPUs to stop.
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  254  		 */
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  255  		if (!smp_no_nmi_ipi && !register_stop_handler()) {
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  256  			/* Sync above data before sending IRQ */
7d007d21e539db Don Zickus     2012-05-11  257  			wmb();
7d007d21e539db Don Zickus     2012-05-11  258  
7d007d21e539db Don Zickus     2012-05-11  259  			pr_emerg("Shutting down cpus with NMI\n");
7d007d21e539db Don Zickus     2012-05-11  260  
7d007d21e539db Don Zickus     2012-05-11  261  			apic->send_IPI_allbutself(NMI_VECTOR);
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  262  		}
7d007d21e539db Don Zickus     2012-05-11  263  		/*
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  264  		 * Don't wait longer than 10 ms if the caller didn't
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  265  		 * reqeust it. If wait is true, the machine hangs here if
ce7fdd5cd83e0a Grzegorz Halat 2019-06-28  266  		 * one or more CPUs do not reach shutdown state.
7d007d21e539db Don Zickus     2012-05-11  267  		 */
7d007d21e539db Don Zickus     2012-05-11  268  		timeout = USEC_PER_MSEC * 10;
7d007d21e539db Don Zickus     2012-05-11  269  		while (num_online_cpus() > 1 && (wait || timeout--))
7d007d21e539db Don Zickus     2012-05-11  270  			udelay(1);
7d007d21e539db Don Zickus     2012-05-11  271  	}
7d007d21e539db Don Zickus     2012-05-11  272  
7d007d21e539db Don Zickus     2012-05-11 @273  finish:
cd7b77710e3d52 Duan, YayongX  2017-12-27  274  	store_regs(NULL);
f9e47a126be2ea Glauber Costa  2008-03-03  275  	local_irq_save(flags);
f9e47a126be2ea Glauber Costa  2008-03-03  276  	disable_local_APIC();
8838eb6c0bf3b6 Ashok Raj      2015-08-12  277  	mcheck_cpu_clear(this_cpu_ptr(&cpu_info));
f9e47a126be2ea Glauber Costa  2008-03-03  278  	local_irq_restore(flags);
f9e47a126be2ea Glauber Costa  2008-03-03  279  }
f9e47a126be2ea Glauber Costa  2008-03-03  280  

:::::: The code at line 273 was first introduced by commit
:::::: 7d007d21e539dbecb6942c5734e6649f720982cf x86/reboot: Use NMI to assist in shutting down if IRQ fails

:::::: TO: Don Zickus <dzickus@redhat.com>
:::::: CC: Ingo Molnar <mingo@kernel.org>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28917 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-11 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-11 15:46 [intel-linux-intel-lts:4.19/android_r 19120/20689] arch/x86/kernel/smp.c:273:1: sparse: sparse: unused label 'finish' kernel test robot

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.