x86/cpu: Provide a declaration for itlb_multihit_kvm_mitigation
authorThomas Gleixner <tglx@linutronix.de>
Mon, 4 Mar 2024 10:12:28 +0000 (11:12 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 4 Mar 2024 11:09:13 +0000 (12:09 +0100)
Sparse complains rightfully about the missing declaration which has been
placed sloppily into the usage site:

  bugs.c:2223:6: sparse: warning: symbol 'itlb_multihit_kvm_mitigation' was not declared. Should it be static?

Add it to <asm/spec-ctrl.h> where it belongs and remove the one in the KVM code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240304005104.787173239@linutronix.de
arch/x86/include/asm/spec-ctrl.h
arch/x86/kvm/mmu/mmu.c

index c648502e453579e3d0deeb9033f2832d9a2fd2a1..658b690b2ccb7d627c6418b32cba5c3a7d959832 100644 (file)
@@ -96,4 +96,6 @@ static inline void speculative_store_bypass_ht_init(void) { }
 extern void speculation_ctrl_update(unsigned long tif);
 extern void speculation_ctrl_update_current(void);
 
+extern bool itlb_multihit_kvm_mitigation;
+
 #endif
index 2d6cdeab1f8a3e78306148d44a4665a1d51d8b1e..3c89d3ebaa3a9d3966a4d5c001beb7090b87da8d 100644 (file)
 #include <asm/cmpxchg.h>
 #include <asm/io.h>
 #include <asm/set_memory.h>
+#include <asm/spec-ctrl.h>
 #include <asm/vmx.h>
 
 #include "trace.h"
 
-extern bool itlb_multihit_kvm_mitigation;
-
 static bool nx_hugepage_mitigation_hard_disabled;
 
 int __read_mostly nx_huge_pages = -1;