From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750891AbbB1HIL (ORCPT ); Sat, 28 Feb 2015 02:08:11 -0500 Received: from terminus.zytor.com ([198.137.202.10]:44057 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbbB1HIH (ORCPT ); Sat, 28 Feb 2015 02:08:07 -0500 Date: Fri, 27 Feb 2015 23:07:00 -0800 From: tip-bot for Steven Rostedt Message-ID: Cc: tglx@linutronix.de, torvalds@linux-foundation.org, luto@amacapital.net, peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, rostedt@goodmis.org, hpa@zytor.com Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, luto@amacapital.net, torvalds@linux-foundation.org, tglx@linutronix.de, hpa@zytor.com, rostedt@goodmis.org In-Reply-To: <20150227145019.2bdd4354@gandalf.local.home> References: <20150227145019.2bdd4354@gandalf.local.home> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86: Init per-cpu shadow copy of CR4 on 32-bit CPUs too Git-Commit-ID: 5b2bdbc84556774afbe11bcfd24c2f6411cfa92b 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: 5b2bdbc84556774afbe11bcfd24c2f6411cfa92b Gitweb: http://git.kernel.org/tip/5b2bdbc84556774afbe11bcfd24c2f6411cfa92b Author: Steven Rostedt AuthorDate: Fri, 27 Feb 2015 14:50:19 -0500 Committer: Ingo Molnar CommitDate: Sat, 28 Feb 2015 08:04:20 +0100 x86: Init per-cpu shadow copy of CR4 on 32-bit CPUs too Commit: 1e02ce4cccdc ("x86: Store a per-cpu shadow copy of CR4") added a shadow CR4 such that reads and writes that do not modify the CR4 execute much faster than always reading the register itself. The change modified cpu_init() in common.c, so that the shadow CR4 gets initialized before anything uses it. Unfortunately, there's two cpu_init()s in common.c. There's one for 64-bit and one for 32-bit. The commit only added the shadow init to the 64-bit path, but the 32-bit path needs the init too. Link: http://lkml.kernel.org/r/20150227125208.71c36402@gandalf.local.home Fixes: 1e02ce4cccdc "x86: Store a per-cpu shadow copy of CR4" Signed-off-by: Steven Rostedt Acked-by: Andy Lutomirski Cc: Peter Zijlstra (Intel) Cc: Linus Torvalds Link: http://lkml.kernel.org/r/20150227145019.2bdd4354@gandalf.local.home Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index b5c8ff5..2346c95 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1396,6 +1396,12 @@ void cpu_init(void) wait_for_master_cpu(cpu); + /* + * Initialize the CR4 shadow before doing anything that could + * try to read it. + */ + cr4_init_shadow(); + show_ucode_info_early(); printk(KERN_INFO "Initializing CPU#%d\n", cpu);