Skip to content

Commit 6845376

Browse files
rddunlaptorvalds
authored andcommitted
ARM: Spectre-BHB: provide empty stub for non-config
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: b9baf5c ("ARM: Spectre-BHB workaround") Signed-off-by: Randy Dunlap <[email protected]> Reported-by: kernel test robot <[email protected]> Cc: Russell King <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Russell King (Oracle) <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 77fe1ba commit 6845376

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arm/include/asm/spectre.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ enum {
2525
SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
2626
};
2727

28+
#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
2829
void spectre_v2_update_state(unsigned int state, unsigned int methods);
30+
#else
31+
static inline void spectre_v2_update_state(unsigned int state,
32+
unsigned int methods)
33+
{}
34+
#endif
2935

3036
int spectre_bhb_update_vectors(unsigned int method);
3137

0 commit comments

Comments
 (0)