From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] ARM: Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv() Date: Fri, 11 Dec 2015 23:26:37 +0100 Message-ID: <1941958.3p422lB7Mz@wuerfel> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: Received: from mout.kundenserver.de ([212.227.126.134]:60741 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753563AbbLKW1N (ORCPT ); Fri, 11 Dec 2015 17:27:13 -0500 In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Nicolas Pitre Cc: linux-arm-kernel@lists.infradead.org, Stephen Boyd , linux-arm-msm@vger.kernel.org, Russell King , =?ISO-8859-1?Q?M=E5ns_Rullg=E5rd?= , Thomas Petazzoni 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