From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Fri, 11 Dec 2015 23:26:37 +0100 Subject: [PATCH] ARM: Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv() In-Reply-To: References: Message-ID: <1941958.3p422lB7Mz@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 > Acked-by: Arnd Bergmann 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