ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 22 Dec 2015 07:24:59 +0000 (08:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 May 2017 11:32:54 +0000 (13:32 +0200)
commit3e8c47e9c1ac31b5a299e404ffac163fc9743f31
tree1f083fde93c32815428159f2f72fc861216f9182
parent436188eb0447fc5117bba45963c783769c44600e
ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode

commit 5008efc83bf85b647aa1cbc44718b1675bbb7444 upstream.

The PJ4 inline asm sequence to write to cp15 cannot be built in Thumb-2
mode, due to the way it performs arithmetic on the program counter, so it
is built in ARM mode instead. However, building C files in ARM mode under
CONFIG_THUMB2_KERNEL is problematic, since the instrumentation performed
by subsystems like ftrace does not expect having to deal with interworking
branches.

Since the sequence in question is simply a poor man's ISB instruction,
let's use a straight 'isb' instead when building in Thumb2 mode. Thumb2
implies V7, so 'isb' should always be supported in that case.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/Makefile
arch/arm/kernel/pj4-cp0.c