* [tglx-devel:x86/topo-full 56/71] arch/x86/kernel/cpu/topology.c:150:31: warning: variable 'bsp_apicid' is uninitialized when used here
@ 2024-01-18 0:00 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-01-18 0:00 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/topo-full
head: db28d91b811f57395f2628ad23002acaef9e1ee1
commit: 3159457cc55b83cde16d0db14e765eabd4160b98 [56/71] x86/cpu: Detect real BSP on crash kernels
config: i386-buildonly-randconfig-003-20240118 (https://download.01.org/0day-ci/archive/20240118/202401180751.hErhvgvl-lkp@intel.com/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240118/202401180751.hErhvgvl-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/202401180751.hErhvgvl-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> arch/x86/kernel/cpu/topology.c:150:31: warning: variable 'bsp_apicid' is uninitialized when used here [-Wuninitialized]
150 | topo_info.real_bsp_apic_id = bsp_apicid;
| ^~~~~~~~~~
arch/x86/kernel/cpu/topology.c:123:16: note: initialize the variable 'bsp_apicid' to silence this warning
123 | u32 bsp_apicid;
| ^
| = 0
arch/x86/kernel/cpu/topology.c:156:11: warning: unused variable 'dom' [-Wunused-variable]
156 | int cpu, dom;
| ^~~
2 warnings generated.
vim +/bsp_apicid +150 arch/x86/kernel/cpu/topology.c
120
121 static __init bool check_for_real_bsp(u32 apic_id)
122 {
123 u32 bsp_apicid;
124
125 /*
126 * There is no real good way to detect whether this a kdump()
127 * kernel, but except on the Voyager SMP monstrosity which is not
128 * longer supported, the real BSP APIC ID is the first one which is
129 * enumerated by firmware. That allows to detect whether the boot
130 * CPU is the real BSP. If it is not, then do not register the APIC
131 * because sending INIT to the real BSP would reset the whole
132 * system.
133 *
134 * The first APIC ID which is enumerated by firmware is detectable
135 * because the boot CPU APIC ID is registered before that without
136 * invoking this code.
137 */
138 if (topo_info.real_bsp_apic_id != BAD_APICID)
139 return false;
140
141 if (apic_id == topo_info.boot_cpu_apic_id) {
142 topo_info.real_bsp_apic_id = apic_id;
143 return false;
144 }
145
146 pr_warn("Boot CPU APIC ID not the first enumerated APIC ID: %x > %x\n",
147 topo_info.boot_cpu_apic_id, bsp_apicid);
148 pr_warn("Crash kernel detected. Disabling real BSP to prevent machine INIT\n");
149
> 150 topo_info.real_bsp_apic_id = bsp_apicid;
151 return true;
152 }
153
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-18 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 0:00 [tglx-devel:x86/topo-full 56/71] arch/x86/kernel/cpu/topology.c:150:31: warning: variable 'bsp_apicid' is uninitialized when used here kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox