public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [ardb:x86-remove-absolute-percpu 3/5] arch/x86/kernel/cpu/common.c:762:22: error: call to undeclared function 'per_cpu_offset'; ISO C99 and later do not support implicit function declarations
Date: Fri, 22 Mar 2024 12:41:25 +0800	[thread overview]
Message-ID: <202403221215.FeIdb2PC-lkp@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git x86-remove-absolute-percpu
head:   811d6eeae9abffb646afa9c418d4658e6d91cdd6
commit: 82b7a620962b18edb7cb6eaca34fd0bd06073611 [3/5] x86/percpu: Get rid of absolute per-CPU variable placement
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20240322/202403221215.FeIdb2PC-lkp@intel.com/config)
compiler: 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/20240322/202403221215.FeIdb2PC-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/202403221215.FeIdb2PC-lkp@intel.com/

All errors (new ones prefixed by >>):

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


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

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

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

                 reply	other threads:[~2024-03-22  4:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202403221215.FeIdb2PC-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ardb@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox