[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH] x86/spec_ctrl: Extend repoline safey calcuations for eIBRS and Atom parts
- To: Jan Beulich <JBeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Mon, 18 Mar 2019 13:04:27 +0000
- Autocrypt: addr=andrew.cooper3@xxxxxxxxxx; prefer-encrypt=mutual; keydata= mQINBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABtClBbmRyZXcgQ29v cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPokCOgQTAQgAJAIbAwULCQgHAwUVCgkI CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9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ei Liu <wei.liu2@xxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 18 Mar 2019 13:06:50 +0000
- Ironport-data: A9a23:EA0tS6xNQob5lsF1qKR6t4n5zX0aspwBZka6jXDtlgiZGagqdfWiVP 81UsBW+4EGW5tF6P4MeKTiLrgWeUsOSWPO5eiFOjQ6v3RrZu0yAwmJVhntloybJ2j9strO4o QqOa0ul8FiLzGHWtzoQTHghTd3I6aHEsKoT6D3YFNr6dBFACkIr/hbJUo0ZvmkWn3oGG7WSC iN6uLTGJGe8qZp3Wzbz8EMmFKpP4SXd/i5jlRK5wpG0+aOltxFoIL3S63PrV0l+CJ1ksdOgq VAlrib/89WeR59eDdrgioqsL0JGR8/cWgpspKZu8hGqCcZU1HPkjhhTKrM25pKUcjm1t9RwM /QZDoNgwdgdFshXjkwPvGCs1XF4Fc+isEJqNG5+MVl1oUJg8cmqmLLuZwIN9SbH+VbRfmWql HZEMUC6yz7se7zjmdoTpS0zAR8ugLR1GzU24B2xzF6gGgyEnsETNfT3r4CD4X13oXi5E1HHy MKfSEYH6Uipx6zwcAHu1BHWDKRq46jdYtviEIVXGS+um8bfNE9WwA0Yg4CrduXUEKFPSTVr+ VuTm5+4zgpRRtTlE75eYijPJPxds0TmjJjHtgT1L5JbtQHV+mei3PvutxbxZsImLzVEOA13i fpUyp2W81ShUTxoNcEGcaNU80iJigd/hbyzQiH5H0rr0WIjGEnuKJlmKJxp7WK0eVzlMgMOJ SId7iwYzlUmnY1GvhgM0IUfeZxVaOtEg0e0ZvRZFyxTp6Ev6DXF/4jr8DRq3EY/WhZlqWklG ZdyZGlFGEAm1o5AescWFOdxCXomfcLs8WyOBH63PfYyzazWq+j2RwDLUc20wyW/xykGeSQ4N OQIjY5E3GXygonrIYqFGjj772GwtLF8QUVwq0AF94q0/8931958nNAx849SBnns/SddPXoPG SPdBtHIfyI5j9YbNFKG0nrP8+3tOSMq6cTbF1xlRRtFX87tt7q+t8rni08DPgNo8AskHnRqb Yk+sGS41u4YBKOA8c7fgDS0M1gsI18WneMRgqS3yDMRpr30rSbMPhUqNQtsw2sijNysHdSYq zPGBtBSmcEdYh2Ufvm+Uz61JbiMrv6kunwmyv43yHFfs8eU4Bj71iGLyOA3LgqzCyZ52euas P3eDO/5vKo1O5XEeb/3UgOeiNyFg6kQP3ImwSPX8wzhSVHvU3Ww/aGZdy/KVS8FapD1107Ge pQOvyT4pNd7gb3rAGWsuHqteA3LJRy6pfyGg1NH0P51sAB38GUPqgj78xxqMR4L0PskM2gYg JrvlbP1Jrb3ZTNWENVbxrIR2zOuuOQMl0NNDz0DoBLE9NVcQD1MKQFHU3H3ii+l+OkmQejgp wDK3VtMqq6JRyeNEeN95UXCgxkJbycDJ7tj/vPeaBk2T84BNgkZpjdv2AbgDjqc+NbTziHxX LukKeWxnycqfjqLL31iIUlrwStc67MruqYhrL2diuNzwnceB+/NEk3q86eLiJY04IgIHkQRY YI1c7t+TrirDiGpCGyepxzwgwMUgL+CVLA2WdWpF9gYW4hKC5HknEUSZnC4Upevz7srAzm5/ 9XebuFOdwnLyg/jVWtGHagW2rhuWz5UA2UyhxZ8R6/LBLlGMCQhm9be2rohB/s2Cn6jZ+uVp OnT03nQ4LqSdzRjBVwiOIj+026HsOi+BSoHrLjejW2+WOEt8MAVHgq57ie9RAvQPOkONpExn SuRKUgzQzhBIjB8OeKSBJB8vC+uRgCSYBsTAG+t+guMFlJKwjJUP9yFzU3VRi+5XyWlQdPTu aNAu8/UUOVVlWUsFskDnwFw5Q=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Openpgp: preference=signencrypt
On 18/03/2019 11:58, Jan Beulich wrote:
>>>> On 18.03.19 at 12:27, <andrew.cooper3@xxxxxxxxxx> wrote:
>> However, an additional meaning of Enhanced IRBS is that the processor may not
>> be retpoline-safe. The Gemini Lake platform, based on the Goldmont+
>> microarchitecture is the first Atom processor to support eIBRS, even though
>> it
>> is in practice safe.
> But afaict you don't mark them as safe.
Correct. That is deliberate.
> But then again I don't recall:
> Performance-wise, is retpoline considered better or worse than IBRS?
> Depending on that ...
Retpoline is more performant than IRBS as implemented in microcode, but
that is not what we are comparing to here.
Goldmont+ is the first processor with hardware fixes for Spectre v2
issues. This means that IBRS isn't implemented behind the scenes with
"turn off the BTB" or "flush via convoluted means". There is a proper
O(1) flush of the BTB for IBPB, and the BTB now tracks the privilege at
which a prediction was learnt.
Cascade Lake will (AFAIA) be the first Big-Core processor with eIBRS.
I honestly don't know whether retpoline or legacy-IBRS with new hardware
will be faster, but it doesn't really matter - using repotline on
Goldmont+ is not spec compliant.
Teaching Xen about eIBRS is moderately high on my priority list, after
which eIBRS will be the most performant option without a shadow of a doubt.
>
>> --- a/xen/arch/x86/spec_ctrl.c
>> +++ b/xen/arch/x86/spec_ctrl.c
>> @@ -316,8 +316,11 @@ static bool __init retpoline_safe(uint64_t caps)
>> /*
>> * RSBA may be set by a hypervisor to indicate that we may move to a
>> * processor which isn't retpoline-safe.
>> + *
>> + * Processors offering Enhanced IBRS are not guarenteed to be
>> + * repoline-safe.
>> */
>> - if ( caps & ARCH_CAPS_RSBA )
>> + if ( caps & (ARCH_CAPABILITIES_IBRS_ALL | ARCH_CAPS_RSBA) )
>> return false;
> ... are there plans to retrofit EIBRS onto any of the models explicitly
> named in the subsequent switch()? If not, wouldn't you better
> check for it further down, adding Goldmont Plus into ...
EIBRS requires new silicon. It can't be retrofitted in microcode.
>
>> @@ -377,6 +380,23 @@ static bool __init retpoline_safe(uint64_t caps)
>> case 0x9e:
>> return false;
>>
>> + /*
>> + * Atom processors before Goldmont+/Gemini Lake are retpoline-safe.
>> + */
>> + case 0x1c: /* Pineview */
>> + case 0x26: /* Lincroft */
>> + case 0x27: /* Penwell */
>> + case 0x35: /* Cloverview */
>> + case 0x36: /* Cedarview */
>> + case 0x37: /* Baytrail / Valleyview (Silvermont) */
>> + case 0x4d: /* Avaton / Rangely (Silvermont) */
>> + case 0x4c: /* Cherrytrail / Brasswell */
>> + case 0x4a: /* Merrifield */
>> + case 0x5a: /* Moorefield */
>> + case 0x5c: /* Goldmont */
>> + case 0x5f: /* Denverton */
>> + return true;
> ... this set? Or am I simply misreading the patch description?
The switch statement is only intended for "legacy" processors which
don't enumerate explicit information, specifically to prevent it needing
to grow with future fixed silicon.
> As an aside - as mentioned on the other (still unfinished) thread
> regarding one of my patches, there's no mention of Goldmont+
> anywhere in the SDM afaics, it's always Goldmont Plus. I still don't
> understand why you want us to deliberately diverge.
Probably a side effect of shorthands. If Goldmont+ really doesn't exist
anywhere, I'll switch.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|