* [PATCH] ARM: Spectre-BHB: provide empty stub for non-config
@ 2022-03-11 19:18 Randy Dunlap
2022-03-11 19:28 ` Russell King (Oracle)
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2022-03-11 19:18 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, kernel test robot, Russell King, Catalin Marinas,
linux-arm-kernel, patches
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
---
KernelVersion: v5.17-rc7-205-g79b00034e9dc
arch/arm/include/asm/spectre.h | 6 ++++++
1 file changed, 6 insertions(+)
--- linux-next-20220310.orig/arch/arm/include/asm/spectre.h
+++ linux-next-20220310/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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: Spectre-BHB: provide empty stub for non-config
2022-03-11 19:18 [PATCH] ARM: Spectre-BHB: provide empty stub for non-config Randy Dunlap
@ 2022-03-11 19:28 ` Russell King (Oracle)
0 siblings, 0 replies; 2+ messages in thread
From: Russell King (Oracle) @ 2022-03-11 19:28 UTC (permalink / raw)
To: Randy Dunlap
Cc: linux-kernel, kernel test robot, Catalin Marinas,
linux-arm-kernel, patches
On Fri, Mar 11, 2022 at 11:18:20AM -0800, Randy Dunlap wrote:
> 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>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
I'd suggest sending this direct to Linus as I've been doing with the
other fixes for Spectre BHB. Trying to fit it now into a pull request
is just going to be very messy.
Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-11 19:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-11 19:18 [PATCH] ARM: Spectre-BHB: provide empty stub for non-config Randy Dunlap
2022-03-11 19:28 ` Russell King (Oracle)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox