From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751899AbdJRQ0o (ORCPT ); Wed, 18 Oct 2017 12:26:44 -0400 Received: from terminus.zytor.com ([65.50.211.136]:42087 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbdJRQ0l (ORCPT ); Wed, 18 Oct 2017 12:26:41 -0400 Date: Wed, 18 Oct 2017 09:22:13 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: bp@suse.de, tglx@linutronix.de, tony.luck@intel.com, stable@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, torvalds@linux-foundation.org, peterz@infradead.org, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, peterz@infradead.org, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, stable@vger.kernel.org, tony.luck@intel.com, tglx@linutronix.de, bp@suse.de In-Reply-To: <20171018111225.25635-1-bp@alien8.de> References: <20171018111225.25635-1-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/microcode/intel: Disable late loading on model 79 Git-Commit-ID: 723f2828a98c8ca19842042f418fb30dd8cfc0f7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 723f2828a98c8ca19842042f418fb30dd8cfc0f7 Gitweb: https://git.kernel.org/tip/723f2828a98c8ca19842042f418fb30dd8cfc0f7 Author: Borislav Petkov AuthorDate: Wed, 18 Oct 2017 13:12:25 +0200 Committer: Ingo Molnar CommitDate: Wed, 18 Oct 2017 15:20:20 +0200 x86/microcode/intel: Disable late loading on model 79 Blacklist Broadwell X model 79 for late loading due to an erratum. Signed-off-by: Borislav Petkov Acked-by: Tony Luck Cc: Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20171018111225.25635-1-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/microcode/intel.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index 8f7a9bb..7dbcb7a 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -918,6 +919,18 @@ static int get_ucode_fw(void *to, const void *from, size_t n) return 0; } +static bool is_blacklisted(unsigned int cpu) +{ + struct cpuinfo_x86 *c = &cpu_data(cpu); + + if (c->x86 == 6 && c->x86_model == INTEL_FAM6_BROADWELL_X) { + pr_err_once("late loading on model 79 is disabled.\n"); + return true; + } + + return false; +} + static enum ucode_state request_microcode_fw(int cpu, struct device *device, bool refresh_fw) { @@ -926,6 +939,9 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device, const struct firmware *firmware; enum ucode_state ret; + if (is_blacklisted(cpu)) + return UCODE_NFOUND; + sprintf(name, "intel-ucode/%02x-%02x-%02x", c->x86, c->x86_model, c->x86_mask); @@ -950,6 +966,9 @@ static int get_ucode_user(void *to, const void *from, size_t n) static enum ucode_state request_microcode_user(int cpu, const void __user *buf, size_t size) { + if (is_blacklisted(cpu)) + return UCODE_NFOUND; + return generic_load_microcode(cpu, (void *)buf, size, &get_ucode_user); }