Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [ardb:for-kernelci 5/13] arch/x86/kernel/cpu/common.c:763:22: error: call to undeclared function 'per_cpu_offset'; ISO C99 and later do not support implicit function declarations
@ 2024-09-22 12:07 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-22 12:07 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git for-kernelci
head:   14ae2a343392bbe36953a6a4088b44a50c4f9611
commit: 4f9082c38c9d2268ddccecf03551c99ca49933bc [5/13] x86/percpu: Get rid of absolute per-CPU variable placement
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20240922/202409222044.9qXlncXt-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240922/202409222044.9qXlncXt-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/202409222044.9qXlncXt-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/x86/kernel/cpu/common.c:763:22: error: call to undeclared function 'per_cpu_offset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     763 |         wrmsrl(MSR_GS_BASE, per_cpu_offset(cpu));
         |                             ^
   1 error generated.


vim +/per_cpu_offset +763 arch/x86/kernel/cpu/common.c

   734	
   735	/**
   736	 * switch_gdt_and_percpu_base - Switch to direct GDT and runtime per CPU base
   737	 * @cpu:	The CPU number for which this is invoked
   738	 *
   739	 * Invoked during early boot to switch from early GDT and early per CPU to
   740	 * the direct GDT and the runtime per CPU area. On 32-bit the percpu base
   741	 * switch is implicit by loading the direct GDT. On 64bit this requires
   742	 * to update GSBASE.
   743	 */
   744	void __init switch_gdt_and_percpu_base(int cpu)
   745	{
   746		load_direct_gdt(cpu);
   747	
   748	#ifdef CONFIG_X86_64
   749		/*
   750		 * No need to load %gs. It is already correct.
   751		 *
   752		 * Writing %gs on 64bit would zero GSBASE which would make any per
   753		 * CPU operation up to the point of the wrmsrl() fault.
   754		 *
   755		 * Set GSBASE to the new offset. Until the wrmsrl() happens the
   756		 * early mapping is still valid. That means the GSBASE update will
   757		 * lose any prior per CPU data which was not copied over in
   758		 * setup_per_cpu_areas().
   759		 *
   760		 * This works even with stackprotector enabled because the
   761		 * per CPU stack canary is 0 in both per CPU areas.
   762		 */
 > 763		wrmsrl(MSR_GS_BASE, per_cpu_offset(cpu));
   764	#else
   765		/*
   766		 * %fs is already set to __KERNEL_PERCPU, but after switching GDT
   767		 * it is required to load FS again so that the 'hidden' part is
   768		 * updated from the new GDT. Up to this point the early per CPU
   769		 * translation is active. Any content of the early per CPU data
   770		 * which was not copied over in setup_per_cpu_areas() is lost.
   771		 */
   772		loadsegment(fs, __KERNEL_PERCPU);
   773	#endif
   774	}
   775	

-- 
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-09-22 12:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 12:07 [ardb:for-kernelci 5/13] arch/x86/kernel/cpu/common.c:763:22: error: call to undeclared function 'per_cpu_offset'; ISO C99 and later do not support implicit function declarations 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