diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-08-15 00:16:13 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-08-16 21:03:38 +0300 |
commit | c4e34dd99f2e3fdfc63584078ce0fed20f4e7386 (patch) | |
tree | 878a88c5eac132fd5fda2d7559ffc3d35bd6452e /arch/x86/include/asm/extable_fixup_types.h | |
parent | 415d832497098030241605c52ea83d4e2cfa7879 (diff) | |
download | linux-c4e34dd99f2e3fdfc63584078ce0fed20f4e7386.tar.xz |
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>
Diffstat (limited to 'arch/x86/include/asm/extable_fixup_types.h')
-rw-r--r-- | arch/x86/include/asm/extable_fixup_types.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/include/asm/extable_fixup_types.h b/arch/x86/include/asm/extable_fixup_types.h index 503622627400..991e31cfde94 100644 --- a/arch/x86/include/asm/extable_fixup_types.h +++ b/arch/x86/include/asm/extable_fixup_types.h @@ -64,4 +64,6 @@ #define EX_TYPE_UCOPY_LEN4 (EX_TYPE_UCOPY_LEN | EX_DATA_IMM(4)) #define EX_TYPE_UCOPY_LEN8 (EX_TYPE_UCOPY_LEN | EX_DATA_IMM(8)) +#define EX_TYPE_ZEROPAD 20 /* longword load with zeropad on fault */ + #endif |