From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755970AbcI2Ts5 (ORCPT ); Thu, 29 Sep 2016 15:48:57 -0400 Received: from mail.kernel.org ([198.145.29.136]:56508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755835AbcI2TsT (ORCPT ); Thu, 29 Sep 2016 15:48:19 -0400 From: Andy Lutomirski To: x86@kernel.org Cc: david@saggiorato.net, Borislav Petkov , Brian Gerst , linux-kernel@vger.kernel.org, Andy Lutomirski Subject: [PATCH v2 1/2] x86/boot: Fix another __read_cr4() case on 486 Date: Thu, 29 Sep 2016 12:48:11 -0700 Message-Id: <8c453a61c4f44ab6ff43c29780ba04835234d2e5.1475178369.git.luto@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The condition for reading CR4 was wrong: there are some CPUs with CPUID but not CR4. Rather than trying to make the condition exact, using __read_cr4_safe(). Reported-by: david@saggiorato.net Fixes: 18bc7bd523e0 ("x86/boot: Synchronize trampoline_cr4_features and mmu_cr4_features directly") Signed-off-by: Andy Lutomirski --- 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 0fa60f5f5a16..98c9cd6f3b5d 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()); -- 2.7.4