Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Mark Brown <broonie@kernel.org>
Subject: [linux-next:master 5603/5655] arch/x86/kvm/msrs.c:654:7: error: call to undeclared function 'static_cpu_has'; ISO C99 and later do not support implicit function declarations
Date: Sat, 11 Jul 2026 20:54:29 +0800	[thread overview]
Message-ID: <202607112000.6Z3R9tRe-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   bee763d5f341b99cf472afeb508d4988f62a6ca1
commit: d9b292f64e4bc5ab3e14dc0b89a7b0cc47c11e00 [5603/5655] Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm.git
config: x86_64-randconfig-071-20260710 (https://download.01.org/0day-ci/archive/20260711/202607112000.6Z3R9tRe-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260711/202607112000.6Z3R9tRe-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/202607112000.6Z3R9tRe-lkp@intel.com/

Note: the linux-next/master HEAD bee763d5f341b99cf472afeb508d4988f62a6ca1 builds fine.
      It may have been fixed somewhere.

All errors (new ones prefixed by >>):

>> arch/x86/kvm/msrs.c:654:7: error: call to undeclared function 'static_cpu_has'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     654 |         if (!static_cpu_has(X86_FEATURE_XSAVES) &&
         |              ^
   arch/x86/kvm/msrs.c:654:7: note: did you mean '__static_cpu_has'?
   arch/x86/include/asm/cpufeature.h:99:29: note: '__static_cpu_has' declared here
      99 | static __always_inline bool __static_cpu_has(u16 bit)
         |                             ^
   1 error generated.


vim +/static_cpu_has +654 arch/x86/kvm/msrs.c

7a268308015843 Sean Christopherson 2026-06-12  623  
7a268308015843 Sean Christopherson 2026-06-12  624  static int set_efer(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
7a268308015843 Sean Christopherson 2026-06-12  625  {
7a268308015843 Sean Christopherson 2026-06-12  626  	u64 old_efer = vcpu->arch.efer;
7a268308015843 Sean Christopherson 2026-06-12  627  	u64 efer = msr_info->data;
7a268308015843 Sean Christopherson 2026-06-12  628  	int r;
7a268308015843 Sean Christopherson 2026-06-12  629  
7a268308015843 Sean Christopherson 2026-06-12  630  	if (efer & efer_reserved_bits)
7a268308015843 Sean Christopherson 2026-06-12  631  		return 1;
7a268308015843 Sean Christopherson 2026-06-12  632  
7a268308015843 Sean Christopherson 2026-06-12  633  	if (!msr_info->host_initiated) {
7a268308015843 Sean Christopherson 2026-06-12  634  		if (!__kvm_valid_efer(vcpu, efer))
7a268308015843 Sean Christopherson 2026-06-12  635  			return 1;
7a268308015843 Sean Christopherson 2026-06-12  636  
7a268308015843 Sean Christopherson 2026-06-12  637  		if (is_paging(vcpu) &&
7a268308015843 Sean Christopherson 2026-06-12  638  		    (vcpu->arch.efer & EFER_LME) != (efer & EFER_LME))
7a268308015843 Sean Christopherson 2026-06-12  639  			return 1;
7a268308015843 Sean Christopherson 2026-06-12  640  	}
7a268308015843 Sean Christopherson 2026-06-12  641  
7a268308015843 Sean Christopherson 2026-06-12  642  	efer &= ~EFER_LMA;
7a268308015843 Sean Christopherson 2026-06-12  643  	efer |= vcpu->arch.efer & EFER_LMA;
7a268308015843 Sean Christopherson 2026-06-12  644  
7a268308015843 Sean Christopherson 2026-06-12  645  	r = kvm_x86_call(set_efer)(vcpu, efer);
7a268308015843 Sean Christopherson 2026-06-12  646  	if (r) {
7a268308015843 Sean Christopherson 2026-06-12  647  		WARN_ON(r > 0);
7a268308015843 Sean Christopherson 2026-06-12  648  		return r;
7a268308015843 Sean Christopherson 2026-06-12  649  	}
7a268308015843 Sean Christopherson 2026-06-12  650  
7a268308015843 Sean Christopherson 2026-06-12  651  	if ((efer ^ old_efer) & KVM_MMU_EFER_ROLE_BITS)
7a268308015843 Sean Christopherson 2026-06-12  652  		kvm_mmu_reset_context(vcpu);
7a268308015843 Sean Christopherson 2026-06-12  653  
7a268308015843 Sean Christopherson 2026-06-12 @654  	if (!static_cpu_has(X86_FEATURE_XSAVES) &&
7a268308015843 Sean Christopherson 2026-06-12  655  	    (efer & EFER_SVME))
7a268308015843 Sean Christopherson 2026-06-12  656  		kvm_hv_xsaves_xsavec_maybe_warn(vcpu);
7a268308015843 Sean Christopherson 2026-06-12  657  
7a268308015843 Sean Christopherson 2026-06-12  658  	return 0;
7a268308015843 Sean Christopherson 2026-06-12  659  }
7a268308015843 Sean Christopherson 2026-06-12  660  

:::::: The code at line 654 was first introduced by commit
:::::: 7a268308015843c7e8b15dda588b2e9adf45223f KVM: x86: Move the bulk of MSR specific code from x86.c to msrs.{c,h}

:::::: TO: Sean Christopherson <seanjc@google.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>

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

                 reply	other threads:[~2026-07-11 12:55 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=202607112000.6Z3R9tRe-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=broonie@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pbonzini@redhat.com \
    /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