[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 <[email protected]>
Newsgroups dev.linux.lists.llvm,dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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 <[email protected]>
:::::: CC: Paolo Bonzini <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.