[lkml]   [2018]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] ARM; fix cpu_v7_bugs_init reference
The cpu_v7_bugs_init() function is referenced by the ARMv7 processor
implementation, but is defined conditionally, leading to a link error when

arch/arm/mm/proc-v7.o:( undefined reference to `cpu_v7_bugs_init'
arch/arm/mm/proc-v7.o:( undefined reference to `cpu_v7_bugs_init'
arch/arm/mm/proc-v7-bugs.o: In function `cpu_v7_ca8_ibe':
proc-v7-bugs.c:(.text+0x14): undefined reference to `cpu_v7_bugs_init'
arch/arm/mm/proc-v7-bugs.o: In function `cpu_v7_ca15_ibe':
proc-v7-bugs.c:(.text+0x30): undefined reference to `cpu_v7_bugs_init'

There is a '.weak' directive for this symbol, which was apparently
intended to avoid the problem, but the file is lacking an actual global
definition for the function, so it has no effect.

This adds an empty function definition for it, which can now get used
as the fallback.

Fixes: 8d9267cedb9e ("ARM: spectre-v2: harden user aborts in kernel space")
Signed-off-by: Arnd Bergmann <>
arch/arm/mm/proc-v7.S | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 6fe52819e014..8f980e8b0867 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -547,6 +547,11 @@ __v7_setup_stack_ptr:
.word PHYS_RELATIVE(__v7_setup_stack, .)

+ .weak cpu_v7_bugs_init
+ ret lr
.align 2
@@ -554,8 +559,6 @@ __v7_setup_stack:


- .weak cpu_v7_bugs_init
@ define struct processor (see <asm/proc-fns.h> and proc-macros.S)
define_processor_functions v7, dabort=v7_early_abort, pabort=v7_pabort, suspend=1, bugs=cpu_v7_bugs_init

 \ /
  Last update: 2018-05-29 12:24    [W:0.051 / U:3.648 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site