arch/x86/kernel/cpu/intel.c:673:34: warning: variable 'l2' set but not used

From: kernel test robot
Date: Wed Feb 07 2024 - 11:12:16 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6d280f4d760e3bcb4a8df302afebf085b65ec982
commit: 807e9bc8e2fe6b4907f9f77fd073f7ef5073af29 x86/CPU: Move cpu_detect_cache_sizes() into init_intel_cacheinfo()
date: 6 years ago
config: x86_64-randconfig-x051-20230705 (https://download.01.org/0day-ci/archive/20240208/202402080007.mX2pYVVF-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240208/202402080007.mX2pYVVF-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402080007.mX2pYVVF-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

arch/x86/kernel/cpu/intel.c: In function 'init_intel':
>> arch/x86/kernel/cpu/intel.c:673:34: warning: variable 'l2' set but not used [-Wunused-but-set-variable]
673 | unsigned int l1, l2;
| ^~
arch/x86/kernel/cpu/intel.o: warning: objtool: init_intel_misc_features()+0x1d7: sibling call from callable instruction with modified stack frame
arch/x86/kernel/cpu/intel.o: warning: objtool: init_intel_energy_perf()+0x9b: sibling call from callable instruction with modified stack frame
arch/x86/kernel/cpu/intel.o: warning: objtool: detect_tme()+0x150: sibling call from callable instruction with modified stack frame
arch/x86/kernel/cpu/intel.o: warning: objtool: early_init_intel()+0x583: sibling call from callable instruction with modified stack frame


vim +/l2 +673 arch/x86/kernel/cpu/intel.c

635
636 static void init_intel(struct cpuinfo_x86 *c)
637 {
638 early_init_intel(c);
639
640 intel_workarounds(c);
641
642 /*
643 * Detect the extended topology information if available. This
644 * will reinitialise the initial_apicid which will be used
645 * in init_intel_cacheinfo()
646 */
647 detect_extended_topology(c);
648
649 if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) {
650 /*
651 * let's use the legacy cpuid vector 0x1 and 0x4 for topology
652 * detection.
653 */
654 c->x86_max_cores = detect_num_cpu_cores(c);
655 #ifdef CONFIG_X86_32
656 detect_ht(c);
657 #endif
658 }
659
660 init_intel_cacheinfo(c);
661
662 if (c->cpuid_level > 9) {
663 unsigned eax = cpuid_eax(10);
664 /* Check for version and the number of counters */
665 if ((eax & 0xff) && (((eax>>8) & 0xff) > 1))
666 set_cpu_cap(c, X86_FEATURE_ARCH_PERFMON);
667 }
668
669 if (cpu_has(c, X86_FEATURE_XMM2))
670 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
671
672 if (boot_cpu_has(X86_FEATURE_DS)) {
> 673 unsigned int l1, l2;
674
675 rdmsr(MSR_IA32_MISC_ENABLE, l1, l2);
676 if (!(l1 & (1<<11)))
677 set_cpu_cap(c, X86_FEATURE_BTS);
678 if (!(l1 & (1<<12)))
679 set_cpu_cap(c, X86_FEATURE_PEBS);
680 }
681
682 if (c->x86 == 6 && boot_cpu_has(X86_FEATURE_CLFLUSH) &&
683 (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47))
684 set_cpu_bug(c, X86_BUG_CLFLUSH_MONITOR);
685
686 if (c->x86 == 6 && boot_cpu_has(X86_FEATURE_MWAIT) &&
687 ((c->x86_model == INTEL_FAM6_ATOM_GOLDMONT)))
688 set_cpu_bug(c, X86_BUG_MONITOR);
689

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