]> git.baikalelectronics.ru Git - kernel.git/commit
x86: simplify load_unaligned_zeropad() implementation
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 14 Aug 2022 21:16:13 +0000 (14:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Aug 2022 18:03:38 +0000 (11:03 -0700)
commitba75ad4aa9b38e7659cc837bfb91e0853a4158b0
tree878a88c5eac132fd5fda2d7559ffc3d35bd6452e
parent7f9c597c6f6650163b0c9332091badd26012b06b
x86: simplify load_unaligned_zeropad() implementation

The exception for the "unaligned access at the end of the page, next
page not mapped" never happens, but the fixup code ends up causing
trouble for compilers to optimize well.

clang in particular ends up seeing it being in the middle of a loop, and
tries desperately to optimize the exception fixup code that is never
really reached.

The simple solution is to just move all the fixups into the exception
handler itself, which moves it all out of the hot case code, and means
that the compiler never sees it or needs to worry about it.

Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/include/asm/extable_fixup_types.h
arch/x86/include/asm/word-at-a-time.h
arch/x86/mm/extable.c