* [sean-jc:x86/vmxon_sucks 10/16] arch/x86/virt/hw.c:258:56: error: expected ';' after top level declarator
@ 2025-11-22 7:44 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-22 7:44 UTC (permalink / raw)
To: Sean Christopherson; +Cc: llvm, oe-kbuild-all
tree: https://github.com/sean-jc/linux x86/vmxon_sucks
head: 53a0058b6ceb67b7a632bf92718986b1b30438d3
commit: 3e6566e776aa77ac22ffb4bd16fca9e9afc9d98c [10/16] KVM: x86: Extract VMXON and EFER.SVME enablement to kernel
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20251122/202511221537.tOFi3YMn-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/20251122/202511221537.tOFi3YMn-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/202511221537.tOFi3YMn-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/x86/virt/hw.c:258:56: error: expected ';' after top level declarator
258 | static int x86_svm_emergency_disable_virtualization_cpu { BUILD_BUG_ON(1); return -EOPNOTSUPP; }
| ^
| ;
>> arch/x86/virt/hw.c:330:8: error: called object type 'int' is not a function or function pointer
330 | (void)x86_virt_call(emergency_disable_virtualization_cpu);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/virt/hw.c:271:21: note: expanded from macro 'x86_virt_call'
271 | __r = x86_svm_##fn(); \
| ~~~~~~~~~~~~^
2 errors generated.
vim +258 arch/x86/virt/hw.c
254
255 #else
256 static int x86_svm_get_cpu(void) { BUILD_BUG_ON(1); return -EOPNOTSUPP; }
257 static int x86_svm_put_cpu(void) { BUILD_BUG_ON(1); return -EOPNOTSUPP; }
> 258 static int x86_svm_emergency_disable_virtualization_cpu { BUILD_BUG_ON(1); return -EOPNOTSUPP; }
259 static __init int x86_svm_init(void) { return -EOPNOTSUPP; }
260 #endif
261
262 #define x86_virt_call(fn) \
263 ({ \
264 int __r; \
265 \
266 if (IS_ENABLED(CONFIG_KVM_INTEL) && \
267 cpu_feature_enabled(X86_FEATURE_VMX)) \
268 __r = x86_vmx_##fn(); \
269 else if (IS_ENABLED(CONFIG_KVM_AMD) && \
270 cpu_feature_enabled(X86_FEATURE_SVM)) \
271 __r = x86_svm_##fn(); \
272 else \
273 __r = -EOPNOTSUPP; \
274 \
275 __r; \
276 })
277
278 int x86_virt_get_cpu(int feat)
279 {
280 int r;
281
282 if (!x86_virt_feature || x86_virt_feature != feat)
283 return -EOPNOTSUPP;
284
285 if (this_cpu_inc_return(virtualization_nr_users) > 1)
286 return 0;
287
288 r = x86_virt_call(get_cpu);
289 if (r)
290 WARN_ON_ONCE(this_cpu_dec_return(virtualization_nr_users));
291
292 return r;
293 }
294 EXPORT_SYMBOL_GPL(x86_virt_get_cpu);
295
296 void x86_virt_put_cpu(int feat)
297 {
298 if (WARN_ON_ONCE(!this_cpu_read(virtualization_nr_users)) ||
299 this_cpu_dec_return(virtualization_nr_users))
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 if (!x86_virt_feature)
314 return -EOPNOTSUPP;
315
316 /*
317 * IRQs must be disabled as virtualization is enabled in hardware via
318 * function call IPIs, i.e. IRQs need to be disabled to guarantee
319 * virtualization stays disabled.
320 */
321 lockdep_assert_irqs_disabled();
322
323 /*
324 * Do the NMI shootdown even if virtualization is off on _this_ CPU, as
325 * other CPUs may have virtualization enabled.
326 *
327 * TODO: Track whether or not virtualization might be enabled on other
328 * CPUs? May not be worth avoiding the NMI shootdown...
329 */
> 330 (void)x86_virt_call(emergency_disable_virtualization_cpu);
331 return 0;
332 }
333
--
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:[~2025-11-22 7:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-22 7:44 [sean-jc:x86/vmxon_sucks 10/16] arch/x86/virt/hw.c:258:56: error: expected ';' after top level declarator 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;
as well as URLs for NNTP newsgroup(s).