Spectre V1 diagnostic / mitigation
Florian Weimer
fweimer@redhat.com
Wed Dec 19 13:35:00 GMT 2018
* Richard Biener:
> On Wed, 19 Dec 2018, Florian Weimer wrote:
>
>> * Richard Biener:
>>
>> > The cost is probably target dependent - on x86 it's simply a $fs based
>> > load/store.
>>
>> Do you need to reserve something in the TCB for this?
>
> No idea. But I figured using TLS with the patch only works when
> optimizing and not with -O0. Huh. Anyway, it should be equivalent
> to what presence of
>
> __thread void *_SV1MASK = (void *)-1l;
>
> requires (plus I make that symbol GNU_UNIQUE). I see this
> allocates -1 in the .tdata section marked TLS.
Oh. That's going to be substantially worse for PIC, even with the
initial-exec model, especially on architectures which do not have
arbitrary PC-relative loads. Which is why I'm asking about the TCB
reservation.
Thanks,
Florian
More information about the Gcc
mailing list