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

Re: [Xen-devel] [faster-by-no-jump-table] retpoline: disable jump tables



>>> On 20.11.18 at 16:57, <roger.pau@xxxxxxxxxx> wrote:
> On Tue, Nov 20, 2018 at 08:44:31AM -0700, Jan Beulich wrote:
>> >>> On 20.11.18 at 16:37, <nmanthey@xxxxxxxxx> wrote:
>> > To mitigate Meltdown, 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>
> 
> Shouldn't this use cc-option-add, or is it guaranteed that every
> compiler that supports -mindirect-branch-register will also support
> -fno-jump-tables?

I've checked that gcc supports this at least back to 4.1.x. With
this long history I'm pretty sure clang has been doing so too for
a long time.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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