Re: [PATCH] ARM: Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()

Arnd Bergmann
2015-12-11T22:27:13Z

On Friday 11 December 2015 12:22:20 Nicolas Pitre wrote:
> Subject: [PATCH] ARM: Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()
>
> The ARM compiler inserts calls to __aeabi_uidiv() and
> __aeabi_idiv() when it needs to perform division on signed and
> unsigned integers. If a processor has support for the udiv and
> sdiv instructions, the kernel may overwrite the beginning of those
> functions with those instructions and a "bx lr" to get better
> performance.
>
> To ensure those functions are aligned to a 32-bit word for easier
> patching (which might not always be the case in Thumb mode) and the
> two patched instructions for each case are contained in the same cache
> line, a 8-byte alignment is enforced when ARM_PATCH_IDIV is configured.
>
> This was heavily inspired by a previous patch by Stephen Boyd.
>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
>

Acked-by: Arnd Bergmann <arnd@arndb.de>

Before you put it in the patch tracker, I think it would be good to
give Stephen a chance to comment as well, since he did a lot of
work upfront and this obsoletes his original patch series.

Arnd