retpoline: disable jump tables
authorNorbert Manthey <nmanthey@amazon.de>
Wed, 21 Nov 2018 09:52:05 +0000 (10:52 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 21 Nov 2018 09:52:05 +0000 (10:52 +0100)
commit2276da0db9b0f111e1a8f41dd707c6bd1dea9a7d
tree733a4b1b2e21088d82ed06dc6733bad06f4f7ce7
parent725bf00a87fb6db2cfcb89e9aaeee857cc4bc57e
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@amazon.de>
Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/Rules.mk