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

Re: [Xen-devel] [PATCH v9 07/11] x86/boot: Calculate the most appropriate BTI mitigation to use



On 19/01/18 12:06, Jan Beulich wrote:
>>>> On 18.01.18 at 16:46, <andrew.cooper3@xxxxxxxxxx> wrote:
>> @@ -124,7 +186,21 @@ void __init init_speculation_mitigations(void)
>>               */
>>              if ( cpu_has_lfence_dispatch )
>>                  thunk = THUNK_LFENCE;
>> +            /*
>> +             * On Intel hardware, we'd like to use retpoline in preference 
>> to
>> +             * IBRS, but only if it is safe on this hardware.
>> +             */
>> +            else if ( boot_cpu_has(X86_FEATURE_IBRSB) )
>> +            {
>> +                if ( retpoline_safe() )
>> +                    thunk = THUNK_RETPOLINE;
>> +                else
>> +                    ibrs = true;
>> +            }
> I think I had asked about this piece of code before, but maybe not
> the same I'm noticing now: Why is using retpoline dependent upon
> IBRSB? I.e. why not
>
>             else if ( retpoline_safe() )
>                 thunk = THUNK_RETPOLINE;
>             else if ( boot_cpu_has(X86_FEATURE_IBRSB) )
>                 ibrs = true;
>
> ?

Probably because that was my train of though when putting this
together.  It made more of a different in previous iterations when the
IBRS_SET/CLEAR decision was taken here.

~Andrew

_______________________________________________
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®.