From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752583AbcI3KoS (ORCPT ); Fri, 30 Sep 2016 06:44:18 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43134 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbcI3KoJ (ORCPT ); Fri, 30 Sep 2016 06:44:09 -0400 Date: Fri, 30 Sep 2016 03:43:38 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, brgerst@gmail.com, luto@kernel.org, bp@alien8.de Reply-To: luto@kernel.org, bp@alien8.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, brgerst@gmail.com, hpa@zytor.com In-Reply-To: <8c453a61c4f44ab6ff43c29780ba04835234d2e5.1475178369.git.luto@kernel.org> References: <8c453a61c4f44ab6ff43c29780ba04835234d2e5.1475178369.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/boot: Fix another __read_cr4() case on 486 Git-Commit-ID: 192d1dccbfc5b901b66527df9df80304693cf06e 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: 192d1dccbfc5b901b66527df9df80304693cf06e Gitweb: http://git.kernel.org/tip/192d1dccbfc5b901b66527df9df80304693cf06e Author: Andy Lutomirski AuthorDate: Thu, 29 Sep 2016 12:48:11 -0700 Committer: Thomas Gleixner CommitDate: Fri, 30 Sep 2016 12:37:40 +0200 x86/boot: Fix another __read_cr4() case on 486 The condition for reading CR4 was wrong: there are some CPUs with CPUID but not CR4. Rather than trying to make the condition exact, use __read_cr4_safe(). Fixes: 18bc7bd523e0 ("x86/boot: Synchronize trampoline_cr4_features and mmu_cr4_features directly") Reported-by: david@saggiorato.net Signed-off-by: Andy Lutomirski Reviewed-by: Borislav Petkov Cc: Brian Gerst Link: http://lkml.kernel.org/r/8c453a61c4f44ab6ff43c29780ba04835234d2e5.1475178369.git.luto@kernel.org Signed-off-by: Thomas Gleixner --- arch/x86/kernel/setup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 0fa60f5..98c9cd6 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1137,9 +1137,7 @@ void __init setup_arch(char **cmdline_p) * auditing all the early-boot CR4 manipulation would be needed to * rule it out. */ - if (boot_cpu_data.cpuid_level >= 0) - /* A CPU has %cr4 if and only if it has CPUID. */ - mmu_cr4_features = __read_cr4(); + mmu_cr4_features = __read_cr4_safe(); memblock_set_current_limit(get_max_mapped());