]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: spectre-v2: per-CPU vtables to work around big.Little systems
authorRussell King <rmk+kernel@armlinux.org.uk>
Thu, 19 Jul 2018 11:21:31 +0000 (12:21 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 12 Nov 2018 10:51:01 +0000 (10:51 +0000)
commite6b553e7103421572d488a105c763e7384449da2
treeb67a58bae630bacced733e397dab05ceef57166f
parentbb976ac724e811b84a0d7cdb99a97195d98ae365
ARM: spectre-v2: per-CPU vtables to work around big.Little systems

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>
arch/arm/include/asm/proc-fns.h
arch/arm/kernel/setup.c
arch/arm/kernel/smp.c
arch/arm/mm/proc-v7-bugs.c