linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, Zhenzhong Duan <zhenzhong.duan@oracle.com>,
	Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Srinivas Eeda <srinivas.eeda@oracle.com>
Subject: [PATCH] x86/microcode: Remove useless code after early microcode support added
Date: Mon,  1 Apr 2019 16:46:52 +0800	[thread overview]
Message-ID: <1554108412-22229-1-git-send-email-zhenzhong.duan@oracle.com> (raw)

After early microcode update was added, microcode couldn't be configured
as a module, microcode update happens at early bootup and cpu hotplug
stage. This made the microcode update code in module loading stage
useless.

This patch remove the useless code.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Srinivas Eeda <srinivas.eeda@oracle.com>
---
 arch/x86/kernel/cpu/microcode/core.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 5260185..7f05bcb 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -710,10 +710,6 @@ static enum ucode_state microcode_init_cpu(int cpu, bool refresh_fw)
 	if (collect_cpu_info(cpu))
 		return UCODE_ERROR;
 
-	/* --dimm. Trigger a delayed update? */
-	if (system_state != SYSTEM_RUNNING)
-		return UCODE_NFOUND;
-
 	ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev, refresh_fw);
 	if (ustate == UCODE_NEW) {
 		pr_debug("CPU%d updated upon init\n", cpu);
@@ -738,21 +734,14 @@ static enum ucode_state microcode_update_cpu(int cpu)
 
 static int mc_device_add(struct device *dev, struct subsys_interface *sif)
 {
-	int err, cpu = dev->id;
+	int cpu = dev->id;
 
 	if (!cpu_online(cpu))
 		return 0;
 
 	pr_debug("CPU%d added\n", cpu);
 
-	err = sysfs_create_group(&dev->kobj, &mc_attr_group);
-	if (err)
-		return err;
-
-	if (microcode_init_cpu(cpu, true) == UCODE_ERROR)
-		return -EINVAL;
-
-	return err;
+	return sysfs_create_group(&dev->kobj, &mc_attr_group);
 }
 
 static void mc_device_remove(struct device *dev, struct subsys_interface *sif)
-- 
1.8.3.1


             reply	other threads:[~2019-04-02  8:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01  8:46 Zhenzhong Duan [this message]
2019-04-02 15:35 ` [PATCH] x86/microcode: Remove useless code after early microcode support added Borislav Petkov
     [not found]   ` <4c12556d-9663-5cc9-bf0a-b2032110b0cb@oracle.com>
2019-04-03  8:18     ` Borislav Petkov

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=1554108412-22229-1-git-send-email-zhenzhong.duan@oracle.com \
    --to=zhenzhong.duan@oracle.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=srinivas.eeda@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).