]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2022 10:39:18 +0000 (11:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2022 10:39:18 +0000 (11:39 +0100)
added patches:
arm-spectre-bhb-provide-empty-stub-for-non-config.patch

queue-4.9/arm-spectre-bhb-provide-empty-stub-for-non-config.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/arm-spectre-bhb-provide-empty-stub-for-non-config.patch b/queue-4.9/arm-spectre-bhb-provide-empty-stub-for-non-config.patch
new file mode 100644 (file)
index 0000000..c274e28
--- /dev/null
@@ -0,0 +1,49 @@
+From 68453767131a5deec1e8f9ac92a9042f929e585d Mon Sep 17 00:00:00 2001
+From: Randy Dunlap <rdunlap@infradead.org>
+Date: Fri, 11 Mar 2022 11:49:12 -0800
+Subject: ARM: Spectre-BHB: provide empty stub for non-config
+
+From: Randy Dunlap <rdunlap@infradead.org>
+
+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 <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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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);
index f0278b224648ee47de971b3f28e48c39fddf50e0..b3bcfda755e5b0da87d6d7a34670ee641dd4ded0 100644 (file)
@@ -11,3 +11,4 @@ net-sysfs-add-check-for-netdevice-being-present-to-s.patch
 revert-xen-netback-check-for-hotplug-status-existenc.patch
 tracing-ensure-trace-buffer-is-at-least-4096-bytes-l.patch
 selftests-memfd-clean-up-mapping-in-mfd_fail_write.patch
+arm-spectre-bhb-provide-empty-stub-for-non-config.patch