From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752911AbbKWQ26 (ORCPT ); Mon, 23 Nov 2015 11:28:58 -0500 Received: from terminus.zytor.com ([198.137.202.10]:44720 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754152AbbKWQ24 (ORCPT ); Mon, 23 Nov 2015 11:28:56 -0500 Date: Mon, 23 Nov 2015 08:28:16 -0800 From: tip-bot for Borislav Petkov Message-ID: Cc: peterz@infradead.org, bp@suse.de, mingo@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, paulmck@linux.vnet.ibm.com, markus@trippelsdorf.de, torvalds@linux-foundation.org Reply-To: hpa@zytor.com, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, tglx@linutronix.de, markus@trippelsdorf.de, torvalds@linux-foundation.org, peterz@infradead.org, bp@suse.de, mingo@kernel.org, akpm@linux-foundation.org In-Reply-To: <20151120112400.GC4028@pd.tnic> References: <20151120112400.GC4028@pd.tnic> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/microcode: Initialize the driver late when facilities are up Git-Commit-ID: 2d5be37d686c4dae8e60d20283d6f44ac2c44f65 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 2d5be37d686c4dae8e60d20283d6f44ac2c44f65 Gitweb: http://git.kernel.org/tip/2d5be37d686c4dae8e60d20283d6f44ac2c44f65 Author: Borislav Petkov AuthorDate: Fri, 20 Nov 2015 12:24:00 +0100 Committer: Ingo Molnar CommitDate: Mon, 23 Nov 2015 10:39:49 +0100 x86/microcode: Initialize the driver late when facilities are up 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 Signed-off-by: Borislav Petkov Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20151120112400.GC4028@pd.tnic Signed-off-by: Ingo Molnar --- 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 7fc27f1..b3e94ef 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 29db25f..d2bbe34 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