]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ARM: Spectre-BHB: provide empty stub for non-config
authorRandy Dunlap <rdunlap@infradead.org>
Fri, 11 Mar 2022 19:49:12 +0000 (11:49 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Mar 2022 20:42:49 +0000 (12:42 -0800)
When CONFIG_GENERIC_CPU_VULNERABILITIES is not set, references
to spectre_v2_update_state() cause a build error, so provide an
empty stub for that function when the Kconfig option is not set.

Fixes this build error:

  arm-linux-gnueabi-ld: arch/arm/mm/proc-v7-bugs.o: in function `cpu_v7_bugs_init':
  proc-v7-bugs.c:(.text+0x52): undefined reference to `spectre_v2_update_state'
  arm-linux-gnueabi-ld: proc-v7-bugs.c:(.text+0x82): undefined reference to `spectre_v2_update_state'

Fixes: 404a7a266c1a ("ARM: Spectre-BHB workaround")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: patches@armlinux.org.uk
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm/include/asm/spectre.h

index d1fa5607d3aa3ccd9b91be37affabfb15a6cf899..85f9e538fb325730613f78419f52826a68b8d76c 100644 (file)
@@ -25,7 +25,13 @@ enum {
        SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
 };
 
+#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
 void spectre_v2_update_state(unsigned int state, unsigned int methods);
+#else
+static inline void spectre_v2_update_state(unsigned int state,
+                                          unsigned int methods)
+{}
+#endif
 
 int spectre_bhb_update_vectors(unsigned int method);