x86: Add straight-line-speculation mitigation
Make use of an upcoming GCC feature to mitigate straight-line-speculation for x86: https://gcc.gnu.org/g:53a643f8568067d7700a9f2facc8ba39974973d3 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952 https://bugs.llvm.org/show_bug.cgi?id=52323 It's built tested on x86_64-allyesconfig using GCC-12 and GCC-11. Maintenance overhead of this should be fairly low due to objtool validation. Size overhead of all these additional int3 instructions comes to: text data bss dec hex filename 22267751 6933356 2011368 31212475 1dc43bb defconfig-build/vmlinux 22804126 6933356 1470696 31208178 1dc32f2 defconfig-build/vmlinux.sls Or roughly 2.4% additional text. Signed-off-by:Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by:
Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/20211204134908.140103474@infradead.org
Showing
- arch/x86/Kconfig 12 additions, 0 deletionsarch/x86/Kconfig
- arch/x86/Makefile 4 additions, 0 deletionsarch/x86/Makefile
- arch/x86/include/asm/linkage.h 10 additions, 0 deletionsarch/x86/include/asm/linkage.h
- arch/x86/include/asm/static_call.h 1 addition, 1 deletionarch/x86/include/asm/static_call.h
- arch/x86/kernel/ftrace.c 1 addition, 1 deletionarch/x86/kernel/ftrace.c
- arch/x86/kernel/static_call.c 3 additions, 2 deletionsarch/x86/kernel/static_call.c
- arch/x86/lib/memmove_64.S 1 addition, 1 deletionarch/x86/lib/memmove_64.S
- arch/x86/lib/retpoline.S 1 addition, 1 deletionarch/x86/lib/retpoline.S
- scripts/Makefile.build 2 additions, 1 deletionscripts/Makefile.build
- scripts/link-vmlinux.sh 3 additions, 0 deletionsscripts/link-vmlinux.sh
Loading
Please register or sign in to comment