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

[Xen-devel] [PATCH 1/2] x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Thu, 18 Jul 2019 12:09:49 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/77QCDKoT4OyA1szsNFhbW62rB9XBeXO6z6r+BHhLdQ=; b=m2ym+5JbMUuZoQ4pTlJpqDF36D8/qBUM1J8Tk+j6XaMKgNjN6eCw/A+X4cljjB5Iuzfr2WZHoS18v5tJOAsMJAsKaCoSRvIsL7sPqs0YV2d9aSGiQEFHeKiQT1zQzgNSjIujQBcTdfBH2fglkbL5dSYOFk+4/fXtrAZ+LQXMWOL6RnOyzt2s502N6dlFFn2EfiUFJ7mDV7G9pzwvslaZiADjBRM+QG7JdA9gBGF7XjnK4meGaMbB55KAY9+ZVTbZwIJJk/Mt+Pss8rR/o4xi/VLnMIQpkESbKF4rtuAa46qNviztQax1GOtBBkbFWpgg6KrfzKzd6SgN+rVwgWH6Nw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NC7yc/R/TToKE4W4B88esM+pZsmpxJoA9hUJN8oHfWO/kZ8FmW9OpdP9Kv5m98AcaGSgSTcMLdPdy3ZiQzlC1F6aAazTc9Atk9cy0TSX5aqX7DLEZK56z4c+H9gzKaJeoRmlZdzCe/RUmrA0sDCifGYRGgBABbdyztFj2yolpBDC2DXq2/fXm6NNvg01dLxyVxenrY7adRGRryXeYb1zpuoNzDkHA4+PRg9601LVNkdMFkbT4p4xPvDFpmCkHwLKIcohINtfzfyillBXMp84wHjyuc1q3JtJt/1DUBO47qBdV0FpR/n1kAoDM+8doZ/bdx4zVzAtrOpwurEDq6THcw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Jul 2019 12:12:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPWGy1ek8AecLnECtUEoEAro4wg==
  • Thread-topic: [PATCH 1/2] x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata

From: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>

Processors which have self-snooping capability can handle conflicting
memory type across CPUs by snooping its own cache. However, there exists
CPU models in which having conflicting memory types still leads to
unpredictable behavior, machine check errors, or hangs.

Clear this feature on affected CPUs to prevent its use.

Suggested-by: Alan Cox <alan.cox@xxxxxxxxx>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
[Linux commit 1e03bff3600101bd9158d005e4313132e55bdec8]

Strip Yonah - as per ark.intel.com it doesn't look to be 64-bit capable.
Call check_memory_type_self_snoop_errata() only on the boot CPU.

Requested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -15,6 +15,32 @@
  #include "cpu.h"
  
  /*
+ * Processors which have self-snooping capability can handle conflicting
+ * memory type across CPUs by snooping its own cache. However, there exists
+ * CPU models in which having conflicting memory types still leads to
+ * unpredictable behavior, machine check errors, or hangs. Clear this
+ * feature to prevent its use on machines with known erratas.
+ */
+static void __init check_memory_type_self_snoop_errata(void)
+{
+       switch (boot_cpu_data.x86_model) {
+       case 0x0f: /* Merom */
+       case 0x16: /* Merom L */
+       case 0x17: /* Penryn */
+       case 0x1d: /* Dunnington */
+       case 0x1e: /* Nehalem */
+       case 0x1f: /* Auburndale / Havendale */
+       case 0x1a: /* Nehalem EP */
+       case 0x2e: /* Nehalem EX */
+       case 0x25: /* Westmere */
+       case 0x2c: /* Westmere EP */
+       case 0x2a: /* SandyBridge */
+               setup_clear_cpu_cap(X86_FEATURE_SS);
+               break;
+       }
+}
+
+/*
   * Set caps in expected_levelling_cap, probe a specific masking MSR, and set
   * caps in levelling_caps if it is found, or clobber the MSR index if missing.
   * If preset, reads the default value into msr_val.
@@ -256,8 +282,11 @@ static void early_init_intel(struct cpui
            (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
                paddr_bits = 36;
  
-       if (c == &boot_cpu_data)
+       if (c == &boot_cpu_data) {
+               check_memory_type_self_snoop_errata();
+
                intel_init_levelling();
+       }
  
        ctxt_switch_levelling(NULL);
  }

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