Re: [PATCH v2 3/9] ARM: optimize indirect call to handle_arch_irq for v7 cores
From: Arnd Bergmann <arnd@arndb.de>
Date: 2021-10-05 12:13:44
From: Arnd Bergmann <arnd@arndb.de>
Date: 2021-10-05 12:13:44
On Tue, Oct 5, 2021 at 9:15 AM Ard Biesheuvel [off-list ref] wrote:
The current irq_handler macro uses a literal load followed by an explicit assignment of lr before an indirect call, both of which are sub-optimal on recent ARM cores. Replace it by a mov_l call, which will evaluate to a movw/movt pair on v7 cores, avoiding one of the two loads, followed by a call to a newly introduced 'bl_m' macro, which will evaluate to a blx instruction on cores that support it. (Setting lr explicitly rather than via a bl or blx instruction confuses the return address prediction that modern out-of-order cores use to speculatively perform the function return.) Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel