public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Oruba <peter.oruba@amd.com>, LKML <linux-kernel@vger.kernel.org>
Subject: x86, microcode_amd: cleanup, mark request_microcode_user() as unsupported
Date: Tue, 23 Sep 2008 22:56:35 +0200	[thread overview]
Message-ID: <1222203395.23615.1.camel@earth> (raw)


Subject: x86, microcode_amd: cleanup, mark request_microcode_user() as unsupported

(1) mark mc_size in generic_load_microcode() as unitialized_var to avoid
gcc's (false) warning;

(2) mark request_microcode_user() as unsupported. The required changes can be
added later. Note, we don't break any user-space interfaces here, as there were
no kernels with support for AMD-specific ucode update yet. The ucode has
to be updated via 'firmware'.

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
CC: Peter Oruba <peter.oruba@amd.com>

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 8294152..7a1f8ee 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -120,29 +120,7 @@ static int get_matching_microcode(int cpu, void *mc, int rev)
 	unsigned int equiv_cpu_id = 0x00;
 	unsigned int i = 0;
 
-	/*
-	 * FIXME! dimm: do we need this? Why an update via /dev/... is different
-	 * from the one via firmware?
-	 *
-	 * This is a tricky part. We might be called from a write operation
-	 * to the device file instead of the usual process of firmware
-	 * loading. This routine needs to be able to distinguish both
-	 * cases. This is done by checking if there alread is a equivalent
-	 * CPU table installed. If not, we're written through
-	 * /dev/cpu/microcode.
-	 * Since we ignore all checks. The error case in which going through
-	 * firmware loading and that table is not loaded has already been
-	 * checked earlier.
-	 */
 	BUG_ON(equiv_cpu_table == NULL);
-#if 0
-	if (equiv_cpu_table == NULL) {
-		printk(KERN_INFO "microcode: CPU%d microcode update with "
-		       "version 0x%x (current=0x%x)\n",
-		       cpu, mc_header->patch_id, uci->cpu_sig.rev);
-		goto out;
-	}
-#endif
 	current_cpu_id = cpuid_eax(0x00000001);
 
 	while (equiv_cpu_table[i].installed_cpu != 0) {
@@ -362,7 +340,7 @@ static int generic_load_microcode(int cpu, void *data, size_t size,
 	leftover = size - offset;
 
 	while (leftover) {
-		unsigned int mc_size;
+		unsigned int uninitialized_var(mc_size);
 		struct microcode_header_amd *mc_header;
 
 		mc = get_next_ucode(ucode_ptr, leftover, get_ucode_data, &mc_size);
@@ -428,17 +406,11 @@ static int request_microcode_fw(int cpu, struct device *device)
 	return ret;
 }
 
-static int get_ucode_user(void *to, const void *from, size_t n)
-{
-	return copy_from_user(to, from, n);
-}
-
 static int request_microcode_user(int cpu, const void __user *buf, size_t size)
 {
-	/* We should bind the task to the CPU */
-	BUG_ON(cpu != raw_smp_processor_id());
-
-	return generic_load_microcode(cpu, (void*)buf, size, &get_ucode_user);
+	printk(KERN_WARNING "microcode: AMD microcode update via /dev/cpu/microcode"
+			"is not supported\n");
+	return -1;
 }
 
 static void microcode_fini_cpu_amd(int cpu)



             reply	other threads:[~2008-09-23 20:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-23 20:56 Dmitry Adamushko [this message]
2008-09-24  8:32 ` x86, microcode_amd: cleanup, mark request_microcode_user() as unsupported Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1222203395.23615.1.camel@earth \
    --to=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peter.oruba@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox