Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [sean-jc:x86/vmxon_sucks 17/19] arch/x86/virt/hw.c:302:9: error: assigning to 'int' from incompatible type 'void'
Date: Wed, 15 Oct 2025 03:42:21 +0800	[thread overview]
Message-ID: <202510150357.nbUFdnh8-lkp@intel.com> (raw)

tree:   https://github.com/sean-jc/linux x86/vmxon_sucks
head:   24e9ac2db43ec73d19dc6896a507de1ff078c2bc
commit: 72541a6245fb93cdc3c8aa8140b20dd1701c0e63 [17/19] KVM: x86: Extract VMXON and EFER.SVME enablement to kernel
config: x86_64-buildonly-randconfig-004-20251015 (https://download.01.org/0day-ci/archive/20251015/202510150357.nbUFdnh8-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251015/202510150357.nbUFdnh8-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/202510150357.nbUFdnh8-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/x86/virt/hw.c:302:9: error: assigning to 'int' from incompatible type 'void'
     302 |         BUG_ON(x86_virt_call(put_cpu) && !virt_rebooting);
         |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/virt/hw.c:269:7: note: expanded from macro 'x86_virt_call'
     269 |                 __r = x86_svm_##fn();                   \
         |                     ^
   include/asm-generic/bug.h:71:45: note: expanded from macro 'BUG_ON'
      71 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
         |                                    ~~~~~~~~~^~~~~~~~~~
   include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
      77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
>> arch/x86/virt/hw.c:324:8: error: call to undeclared function 'x86_svm_emergency_disable_virtualization_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     324 |         (void)x86_virt_call(emergency_disable_virtualization_cpu);
         |               ^
   arch/x86/virt/hw.c:269:9: note: expanded from macro 'x86_virt_call'
     269 |                 __r = x86_svm_##fn();                   \
         |                       ^
   <scratch space>:209:1: note: expanded from here
     209 | x86_svm_emergency_disable_virtualization_cpu
         | ^
   arch/x86/virt/hw.c:324:8: note: did you mean 'x86_vmx_emergency_disable_virtualization_cpu'?
   arch/x86/virt/hw.c:269:9: note: expanded from macro 'x86_virt_call'
     269 |                 __r = x86_svm_##fn();                   \
         |                       ^
   <scratch space>:209:1: note: expanded from here
     209 | x86_svm_emergency_disable_virtualization_cpu
         | ^
   arch/x86/virt/hw.c:121:12: note: 'x86_vmx_emergency_disable_virtualization_cpu' declared here
     121 | static int x86_vmx_emergency_disable_virtualization_cpu(void)
         |            ^
   2 errors generated.
--
>> arch/x86/kernel/crash.c:114:2: error: call to undeclared function 'x86_virt_emergency_disable_virtualization_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     114 |         x86_virt_emergency_disable_virtualization_cpu();
         |         ^
   1 error generated.


vim +302 arch/x86/virt/hw.c

   293	
   294	void x86_virt_put_cpu(int feat)
   295	{
   296		if (WARN_ON_ONCE(!this_cpu_read(virtualization_nr_users)))
   297			return;
   298	
   299		if (this_cpu_dec_return(virtualization_nr_users) && !virt_rebooting)
   300			return;
   301	
 > 302		BUG_ON(x86_virt_call(put_cpu) && !virt_rebooting);
   303	}
   304	EXPORT_SYMBOL_GPL(x86_virt_put_cpu);
   305	
   306	/*
   307	 * Disable virtualization, i.e. VMX or SVM, to ensure INIT is recognized during
   308	 * reboot.  VMX blocks INIT if the CPU is post-VMXON, and SVM blocks INIT if
   309	 * GIF=0, i.e. if the crash occurred between CLGI and STGI.
   310	 */
   311	int x86_virt_emergency_disable_virtualization_cpu(void)
   312	{
   313		/*
   314		 * IRQs must be disabled as virtualization is enabled in hardware via
   315		 * function call IPIs, i.e. IRQs need to be disabled to guarantee
   316		 * virtualization stays disabled.
   317		 */
   318		lockdep_assert_irqs_disabled();
   319	
   320		/*
   321		 * TODO: Track whether or not virtualization might be enabled on other
   322		 *	 CPUs?  May not be worth avoiding the NMI shootdown...
   323		 */
 > 324		(void)x86_virt_call(emergency_disable_virtualization_cpu);
   325		return 0;
   326	}
   327	

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

                 reply	other threads:[~2025-10-14 19:43 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=202510150357.nbUFdnh8-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=seanjc@google.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