[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-1e03bff3600101bd9158d005e4313132e55bdec8@git.kernel.org>
Date: Thu, 27 Jun 2019 22:25:04 -0700
From: tip-bot for Ricardo Neri <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hdegoede@...hat.com, tony.luck@...el.com,
andriy.shevchenko@...el.com, andi.kleen@...el.com,
alan.cox@...el.com, ricardo.neri-calderon@...ux.intel.com,
gregkh@...uxfoundation.org, mohammad.etemadi@...el.com,
ak@...ux.intel.com, mail@...dan-borgner.de, mingo@...nel.org,
hpa@...or.com, andriy.shevchenko@...ux.intel.com, bp@...e.de,
ravi.v.shankar@...el.com, tglx@...utronix.de,
rafael.j.wysocki@...el.com, linux-kernel@...r.kernel.org,
ricardo.neri@...el.com, pfeiner@...gle.com
Subject: [tip:x86/cpu] x86/cpu/intel: Clear cache self-snoop capability in
CPUs with known errata
Commit-ID: 1e03bff3600101bd9158d005e4313132e55bdec8
Gitweb: https://git.kernel.org/tip/1e03bff3600101bd9158d005e4313132e55bdec8
Author: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
AuthorDate: Thu, 27 Jun 2019 19:35:36 -0700
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 28 Jun 2019 07:20:48 +0200
x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata
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@...el.com>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Borislav Petkov <bp@...e.de>
Cc: Tony Luck <tony.luck@...el.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Andi Kleen <andi.kleen@...el.com>
Cc: Hans de Goede <hdegoede@...hat.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jordan Borgner <mail@...dan-borgner.de>
Cc: "Ravi V. Shankar" <ravi.v.shankar@...el.com>
Cc: Mohammad Etemadi <mohammad.etemadi@...el.com>
Cc: Ricardo Neri <ricardo.neri@...el.com>
Cc: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Peter Feiner <pfeiner@...gle.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Link: https://lkml.kernel.org/r/1561689337-19390-2-git-send-email-ricardo.neri-calderon@linux.intel.com
---
arch/x86/kernel/cpu/intel.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index f17c1a714779..8d6d92ebeb54 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -66,6 +66,32 @@ void check_mpx_erratum(struct cpuinfo_x86 *c)
}
}
+/*
+ * 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 check_memory_type_self_snoop_errata(struct cpuinfo_x86 *c)
+{
+ switch (c->x86_model) {
+ case INTEL_FAM6_CORE_YONAH:
+ case INTEL_FAM6_CORE2_MEROM:
+ case INTEL_FAM6_CORE2_MEROM_L:
+ case INTEL_FAM6_CORE2_PENRYN:
+ case INTEL_FAM6_CORE2_DUNNINGTON:
+ case INTEL_FAM6_NEHALEM:
+ case INTEL_FAM6_NEHALEM_G:
+ case INTEL_FAM6_NEHALEM_EP:
+ case INTEL_FAM6_NEHALEM_EX:
+ case INTEL_FAM6_WESTMERE:
+ case INTEL_FAM6_WESTMERE_EP:
+ case INTEL_FAM6_SANDYBRIDGE:
+ setup_clear_cpu_cap(X86_FEATURE_SELFSNOOP);
+ }
+}
+
static bool ring3mwait_disabled __read_mostly;
static int __init ring3mwait_disable(char *__unused)
@@ -304,6 +330,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
}
check_mpx_erratum(c);
+ check_memory_type_self_snoop_errata(c);
/*
* Get the number of SMT siblings early from the extended topology
Powered by blists - more mailing lists