From: Greg Kroah-Hartman Date: Sat, 12 Mar 2022 10:40:49 +0000 (+0100) Subject: 5.16-stable patches X-Git-Tag: v4.9.307~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d49b3c7b93a19f9a5771435a9cd1cf27f51c923;p=thirdparty%2Fkernel%2Fstable-queue.git 5.16-stable patches added patches: arm-spectre-bhb-provide-empty-stub-for-non-config.patch --- diff --git a/queue-5.16/arm-spectre-bhb-provide-empty-stub-for-non-config.patch b/queue-5.16/arm-spectre-bhb-provide-empty-stub-for-non-config.patch new file mode 100644 index 00000000000..c274e28e0d5 --- /dev/null +++ b/queue-5.16/arm-spectre-bhb-provide-empty-stub-for-non-config.patch @@ -0,0 +1,49 @@ +From 68453767131a5deec1e8f9ac92a9042f929e585d Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Fri, 11 Mar 2022 11:49:12 -0800 +Subject: ARM: Spectre-BHB: provide empty stub for non-config + +From: Randy Dunlap + +commit 68453767131a5deec1e8f9ac92a9042f929e585d upstream. + +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: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") +Signed-off-by: Randy Dunlap +Reported-by: kernel test robot +Cc: Russell King +Cc: Catalin Marinas +Cc: linux-arm-kernel@lists.infradead.org +Cc: patches@armlinux.org.uk +Acked-by: Russell King (Oracle) +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/include/asm/spectre.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/arch/arm/include/asm/spectre.h ++++ b/arch/arm/include/asm/spectre.h +@@ -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); + diff --git a/queue-5.16/series b/queue-5.16/series index 179e07c6668..7f02e118e7b 100644 --- a/queue-5.16/series +++ b/queue-5.16/series @@ -83,3 +83,4 @@ tracing-osnoise-make-osnoise_main-to-sleep-for-micro.patch tracing-fix-selftest-config-check-for-function-graph.patch selftest-vm-fix-map_fixed_noreplace-test-failure.patch selftests-memfd-clean-up-mapping-in-mfd_fail_write.patch +arm-spectre-bhb-provide-empty-stub-for-non-config.patch