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

[Xen-devel] [PATCH] x86/spec_ctrl: Extend repoline safey calcuations for eIBRS and Atom parts


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 18 Mar 2019 11:27:49 +0000
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 18 Mar 2019 11:27:55 +0000
  • Ironport-data: A9a23:9zB91qh0T5gCfSiZ4b33pdYgX17brhtd0cWghKucUGXUl+Aq9fhyHx idSIHjUbrbvJbJflnPywgPmyaELcbgg55+41IiYK0J/rO4vCIPNm4YlcisxcMo6EDJtVhouH lnfLnd0BbTxWN97WEOn+xIlDzzOQF64rHV0GIjPtEJu6MOqcBrczNfYK4ExxUV+tc0NlyzT4 jBstAiOnmvAQpW2GVHj3G/hgHIWm4sXgrMSgt4KV6K7YVc0yrS+KfTVQYJyzc5M5WTdBqQLk oQEqhvBP0ZO4Obfxw+I6Ia/frJsC8EByLMYGK8EXyOrhK+NNLDMPnBw8ZQcFu0uLq0WHZLhf VHrz8h4NjToZW11yWaJh4wK7jcZhZElXLOKIlJBKPPiw+v7yfX7euW247Zi8xcAaenPM00Ws dYbwRqh808vvCLBaZP8EZa7YfJ4kF8AGEH7mYsbja9hhq0MRfM2yDuqlga9TjvVj+Q8qTcti pgpUXw8CsPcSwqz8mVHyPoHasrAUVGLNhLNlXZ0cX77vru0wRvExinrR7wbUga/DbLcTlOLF BvSZXmlm36newuAfZemA7XpNNthyzTc6qvEFGK70xKBf3H036Ak4yJPhF4FLoT0Ygs88lRJm sc5uJvSaZiBkV3ulBQNbOVMdzhq5tyGJSVdtboeoF5o24pnr4ZgjeLfI9sP5P+F6t0av0T/B owhTViaNhwMm/erZCPv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2 WiYx2hd5QGg62H604tAmzOqPZ39Hekw5jdYKvzr01g5GwCtaXPoD7Rc53aMTCHaas=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

All currently-released Atom processors are in practice retpoline-safe, because
they don't fall back to a BTB prediction on RSB underflow.

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.

Until Xen gets full eIBRS support, Gemini Lake will still be safe using
regular IBRS.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/spec_ctrl.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index ad72ecd..d981a1c 100644
--- 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;
 
     switch ( boot_cpu_data.x86_model )
@@ -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;
+
     default:
         printk("Unrecognised CPU model %#x - assuming not reptpoline safe\n",
                boot_cpu_data.x86_model);
-- 
2.1.4


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