]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ARM: spectre-v2: per-CPU vtables to work around big.Little systems
authorRussell King <rmk+kernel@armlinux.org.uk>
Thu, 14 Feb 2019 02:10:20 +0000 (21:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:20:47 +0000 (10:20 +0100)
commit89229bc38d9c98e0cde2c83a7e7e360ed1400911
tree4eed61653231d4df267f3302547044f13f8c484e
parent94944687acf7d398099c3841a99553c65201df98
ARM: spectre-v2: per-CPU vtables to work around big.Little systems

Commit 383fb3ee8024d596f488d2dbaf45e572897acbdb upstream.

In big.Little systems, some CPUs require the Spectre workarounds in
paths such as the context switch, but other CPUs do not.  In order
to handle these differences, we need per-CPU vtables.

We are unable to use the kernel's per-CPU variables to support this
as per-CPU is not initialised at times when we need access to the
vtables, so we have to use an array indexed by logical CPU number.

We use an array-of-pointers to avoid having function pointers in
the kernel's read/write .data section.

Reviewed-by: Julien Thierry <julien.thierry@arm.com>
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>
Tested-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/include/asm/proc-fns.h
arch/arm/kernel/setup.c
arch/arm/kernel/smp.c
arch/arm/mm/proc-v7-bugs.c