Skip to content

Commit 11ca2bd

Browse files
Russell KingLee Jones
authored andcommitted
ARM: ensure that processor vtables is not lost after boot
Commit 3a4d0c2 upstream. Marek Szyprowski reported problems with CPU hotplug in current kernels. This was tracked down to the processor vtables being located in an init section, and therefore discarded after kernel boot, despite being required after boot to properly initialise the non-boot CPUs. Arrange for these tables to end up in .rodata when required. Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Fixes: 383fb3e ("ARM: spectre-v2: per-CPU vtables to work around big.Little systems") Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David A. Long <dave.long@linaro.org> Reviewed-by: Julien Thierry <julien.thierry@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Change-Id: I44f7cc28aa6753545c32d8ee5dbd56945b17eb37
1 parent 063a95f commit 11ca2bd

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

arch/arm/mm/proc-macros.S

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@
259259
.endm
260260

261261
.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0
262+
/*
263+
* If we are building for big.Little with branch predictor hardening,
264+
* we need the processor function tables to remain available after boot.
265+
*/
266+
#if 1 // defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR)
267+
.section ".rodata"
268+
#endif
262269
.type \name\()_processor_functions, #object
263270
.align 2
264271
ENTRY(\name\()_processor_functions)
@@ -293,6 +300,9 @@ ENTRY(\name\()_processor_functions)
293300
.endif
294301

295302
.size \name\()_processor_functions, . - \name\()_processor_functions
303+
#if 1 // defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR)
304+
.previous
305+
#endif
296306
.endm
297307

298308
.macro define_cache_functions name:req

0 commit comments

Comments
 (0)