All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/microcode/intel: Disable late loading on model 79
@ 2017-10-18 11:12 Borislav Petkov
  2017-10-18 16:22 ` [tip:x86/urgent] " tip-bot for Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2017-10-18 11:12 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Tony Luck

From: Borislav Petkov <bp@suse.de>

Blacklist Broadwell X model 79 for late loading due to an erratum.

Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Cc: <stable@vger.kernel.org>
---
 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 8f7a9bbad514..7dbcb7adf797 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -34,6 +34,7 @@
 #include <linux/mm.h>
 
 #include <asm/microcode_intel.h>
+#include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/tlbflush.h>
 #include <asm/setup.h>
@@ -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);
 }
 
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* Re: [tip:x86/urgent] x86/microcode/intel: Disable late loading on model 79
@ 2017-12-30 17:38 sonofagun
  0 siblings, 0 replies; 4+ messages in thread
From: sonofagun @ 2017-12-30 17:38 UTC (permalink / raw)
  To: linux-kernel


I suppose it is for Broadwell EX(Expandable or Expensive, whichever you like). The patch description is wrong!
Document 334165-010US describes erratum BDF90:

Loading Microcode Updates or Executing an Authenticated Code Module May Result
in a System Hang

I have not read such a bug in the past. I only knew that AMD K7 could not get microcode updates at all.
Broadwell EX must not have their microcode updated because loading it will cause an UE if the microcode has signature less than 0x0b000021.
I will check what is the signature of the latest update supplied by intel for this model just out of curiosity.

This patch does not check microcode signature, it disables all updates. Is that intentional?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-30 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 11:12 [PATCH] x86/microcode/intel: Disable late loading on model 79 Borislav Petkov
2017-10-18 16:22 ` [tip:x86/urgent] " tip-bot for Borislav Petkov
2017-11-01 12:12   ` Peter Zijlstra
2017-12-30 17:38 sonofagun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.