Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [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
@ 2026-07-11 12:54 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-07-11 12:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: llvm, oe-kbuild-all, Mark Brown

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-11 12:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-11 12:54 [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 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