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 config: x86_64-randconfig-r005-20201209 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5ff35356f1af2bb92785b38c657463924d9ec386) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # 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 COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): arch/x86/kernel/smp.c:190:16: warning: no previous prototype for function 'smp_reboot_interrupt' [-Wmissing-prototypes] __visible void smp_reboot_interrupt(struct pt_regs *regs) ^ arch/x86/kernel/smp.c:190:11: note: declare 'static' if the function is not intended to be used outside of this translation unit __visible void smp_reboot_interrupt(struct pt_regs *regs) ^ static >> arch/x86/kernel/smp.c:273:1: warning: unused label 'finish' [-Wunused-label] finish: ^~~~~~~ arch/x86/kernel/smp.c:285:28: warning: no previous prototype for function 'smp_reschedule_interrupt' [-Wmissing-prototypes] __visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs) ^ arch/x86/kernel/smp.c:285:11: note: declare 'static' if the function is not intended to be used outside of this translation unit __visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs) ^ static arch/x86/kernel/smp.c:306:28: warning: no previous prototype for function 'smp_call_function_interrupt' [-Wmissing-prototypes] __visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs) ^ arch/x86/kernel/smp.c:306:11: note: declare 'static' if the function is not intended to be used outside of this translation unit __visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs) ^ static arch/x86/kernel/smp.c:316:28: warning: no previous prototype for function 'smp_call_function_single_interrupt' [-Wmissing-prototypes] __visible void __irq_entry smp_call_function_single_interrupt(struct pt_regs *r) ^ arch/x86/kernel/smp.c:316:11: note: declare 'static' if the function is not intended to be used outside of this translation unit __visible void __irq_entry smp_call_function_single_interrupt(struct pt_regs *r) ^ static 5 warnings generated. vim +/finish +273 arch/x86/kernel/smp.c 7d007d21e539db Don Zickus 2012-05-11 185 f9e47a126be2ea Glauber Costa 2008-03-03 186 /* f9e47a126be2ea Glauber Costa 2008-03-03 187 * this function calls the 'stop' function on all other CPUs in the system. f9e47a126be2ea Glauber Costa 2008-03-03 188 */ f9e47a126be2ea Glauber Costa 2008-03-03 189 cd7b77710e3d52 Duan, YayongX 2017-12-27 @190 __visible void smp_reboot_interrupt(struct pt_regs *regs) 4ef702c10b5df1 Andi Kleen 2009-05-27 191 { 6dc17876055360 Thomas Gleixner 2015-05-15 192 ipi_entering_ack_irq(); cd7b77710e3d52 Duan, YayongX 2017-12-27 193 store_regs(regs); fba4f472b33aa8 Tiantian Feng 2017-04-19 194 cpu_emergency_vmxoff(); 4ef702c10b5df1 Andi Kleen 2009-05-27 195 stop_this_cpu(NULL); 4ef702c10b5df1 Andi Kleen 2009-05-27 196 irq_exit(); 4ef702c10b5df1 Andi Kleen 2009-05-27 197 } 4ef702c10b5df1 Andi Kleen 2009-05-27 198 ce7fdd5cd83e0a Grzegorz Halat 2019-06-28 199 static int register_stop_handler(void) ce7fdd5cd83e0a Grzegorz Halat 2019-06-28 200 { ce7fdd5cd83e0a Grzegorz Halat 2019-06-28 201 return register_nmi_handler(NMI_LOCAL, smp_stop_nmi_callback, ce7fdd5cd83e0a Grzegorz Halat 2019-06-28 202 NMI_FLAG_FIRST, "smp_stop"); ce7fdd5cd83e0a Grzegorz Halat 2019-06-28 203 } 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 :::::: CC: Ingo Molnar --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org