public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH tip-urgent 4/6] x86/microcode: Initialize the driver late when facilities are up
Date: Mon, 23 Nov 2015 11:12:24 +0100	[thread overview]
Message-ID: <1448273546-2567-5-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1448273546-2567-1-git-send-email-bp@alien8.de>

From: Borislav Petkov <bp@suse.de>

Running microcode_init() from setup_arch() is a bad idea because not
even kmalloc() is ready at that point and the loader does all kinds of
allocations and init/registration with various subsystems.

Make it a late initcall when required facilities are initialized so that
the microcode driver initialization can succeed too.

Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/cpu/microcode/core.c | 1 +
 arch/x86/kernel/setup.c              | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 7fc27f1cca58..b3e94ef461fd 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -698,3 +698,4 @@ int __init microcode_init(void)
 	return error;
 
 }
+late_initcall(microcode_init);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 29db25f9a745..d2bbe343fda7 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1250,8 +1250,6 @@ void __init setup_arch(char **cmdline_p)
 	if (efi_enabled(EFI_BOOT))
 		efi_apply_memmap_quirks();
 #endif
-
-	microcode_init();
 }
 
 #ifdef CONFIG_X86_32
-- 
2.3.5


  parent reply	other threads:[~2015-11-23 10:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 10:12 [PATCH 0/6] tip-queue 2015-11-23 Borislav Petkov
2015-11-23 10:12 ` [PATCH 1/6] x86/cpu: Unify CPU family, model, stepping calculation Borislav Petkov
2015-11-24  9:32   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` [PATCH 2/6] kvm: Add accessors for guest CPU's family, model, stepping Borislav Petkov
2015-11-24  9:32   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` [PATCH 3/6] x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR Borislav Petkov
2015-11-24  9:33   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` Borislav Petkov [this message]
2015-11-23 10:12 ` [PATCH 5/6] x86/cpu: Fix MSR value truncation issue Borislav Petkov
2015-11-24  9:33   ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2015-11-23 10:12 ` [PATCH 6/6] x86/MSR: Chop off lower 32-bit value Borislav Petkov
2015-11-24  9:33   ` [tip:x86/cpu] " tip-bot for 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=1448273546-2567-5-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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