linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86, microcode_amd: Add support for CPU family specific container files
@ 2012-01-05 20:02 Andreas Herrmann
  2012-01-20 16:44 ` [PATCH resend] " Andreas Herrmann
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Herrmann @ 2012-01-05 20:02 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner
  Cc: linux-kernel, Borislav Petkov


We've decided to provide CPU family specific container files (starting
with CPU family 15h). E.g. for family 15h we have to load
microcode_amd_fam15h.bin instead of microcode_amd.bin

Rationale is that starting with family 15h patch size is larger than
2KB which was hard coded as maximum patch size in various microcode
loaders (not just Linux).

Container files which include patches larger than 2KB cause different
kinds of trouble with such old patch loaders. Thus we have to ensure
that the default container file provides only patches with size less
than 2KB.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
 arch/x86/kernel/microcode_amd.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index fe86493..d4e679a 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -313,11 +313,16 @@ out:
 
 static enum ucode_state request_microcode_amd(int cpu, struct device *device)
 {
-	const char *fw_name = "amd-ucode/microcode_amd.bin";
+	char fw_name[36] = "amd-ucode/microcode_amd.bin";
 	const struct firmware *fw;
 	enum ucode_state ret = UCODE_NFOUND;
+	struct cpuinfo_x86 *c = &cpu_data(cpu);
+
+	if (c->x86 >= 0x15)
+		snprintf(fw_name, sizeof(fw_name),
+			 "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86);
 
-	if (request_firmware(&fw, fw_name, device)) {
+	if (request_firmware(&fw, (const char *) fw_name, device)) {
 		pr_err("failed to load file %s\n", fw_name);
 		goto out;
 	}
-- 
1.7.8.1




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

end of thread, other threads:[~2012-01-26 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-05 20:02 [PATCH] x86, microcode_amd: Add support for CPU family specific container files Andreas Herrmann
2012-01-20 16:44 ` [PATCH resend] " Andreas Herrmann
2012-01-26 13:41   ` [tip:x86/urgent] x86/microcode_amd: " tip-bot for Andreas Herrmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).