ARM: 8477/1: runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()
authorNicolas Pitre <nicolas.pitre@linaro.org>
Sat, 12 Dec 2015 01:49:21 +0000 (02:49 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 17 Dec 2015 10:29:01 +0000 (10:29 +0000)
commit42f25bddd0a226d2431e057b9e01c5cc61067e12
tree33e3bf9c4669caba06f72303e5d333e2acd15e78
parent38fc2f6c98262913388de338d5b0cda67e3f78cd
ARM: 8477/1: runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()

The ARM compiler inserts calls to __aeabi_idiv() and
__aeabi_uidiv() when it needs to perform division on signed and
unsigned integers. If a processor has support for the sdiv and
udiv instructions, the kernel may overwrite the beginning of those
functions with those instructions and a "bx lr" to get better
performance.

To ensure that those functions are aligned to a 32-bit word for easier
patching (which might not always be the case in Thumb mode) and that
the two patched instructions end up in the same cache line, a 8-byte
alignment is enforced when ARM_PATCH_IDIV is selected.

This was heavily inspired by a previous patch from Stephen Boyd.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig
arch/arm/kernel/setup.c
arch/arm/lib/lib1funcs.S
This page took 0.027401 seconds and 5 git commands to generate.