[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] retpoline: disable jump tables



commit 2276da0db9b0f111e1a8f41dd707c6bd1dea9a7d
Author:     Norbert Manthey <nmanthey@xxxxxxxxx>
AuthorDate: Wed Nov 21 10:52:05 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 21 10:52:05 2018 +0100

    retpoline: disable jump tables
    
    To mitigate Spectre v2, Xen has been fixed with a software fix, namely
    using retpoline sequences generated by the compiler. This way, indirect
    branches are protected against the attack.
    
    However, the retpoline sequence comes with a slow down. To make up for
    this, we propose to avoid jump tables in the first place. Without the
    retpoline sequences, this code would be less efficient. However, when
    retpoline is enabled, this actually results in a slight performance
    improvement.
    
    This change might become irrelevant once the compiler starts avoiding
    jump tables in case retpolines are used:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86952
    
    Reported-by: Julian Stecklina <jsteckli@xxxxxxxxx>
    Reported-by: Pawel Wieczorkiewicz <wipawel@xxxxxxxxx>
    Signed-off-by: Norbert Manthey <nmanthey@xxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/Rules.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index cc301cdc5b..3f2687bbe4 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -48,6 +48,7 @@ endif
 ifneq ($(call cc-option,$(CC),-mindirect-branch-register,n),n)
 CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register
 CFLAGS += -DCONFIG_INDIRECT_THUNK
+CFLAGS += -fno-jump-tables
 export CONFIG_INDIRECT_THUNK=y
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.