Skip to content

Commit 192d1dc

Browse files
amlutoKAGA-KOKO
authored andcommitted
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: 18bc7bd ("x86/boot: Synchronize trampoline_cr4_features and mmu_cr4_features directly") Reported-by: david@saggiorato.net Signed-off-by: Andy Lutomirski <luto@kernel.org> Reviewed-by: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Link: http://lkml.kernel.org/r/8c453a61c4f44ab6ff43c29780ba04835234d2e5.1475178369.git.luto@kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent e1bfc11 commit 192d1dc

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

arch/x86/kernel/setup.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,9 +1137,7 @@ void __init setup_arch(char **cmdline_p)
11371137
* auditing all the early-boot CR4 manipulation would be needed to
11381138
* rule it out.
11391139
*/
1140-
if (boot_cpu_data.cpuid_level >= 0)
1141-
/* A CPU has %cr4 if and only if it has CPUID. */
1142-
mmu_cr4_features = __read_cr4();
1140+
mmu_cr4_features = __read_cr4_safe();
11431141

11441142
memblock_set_current_limit(get_max_mapped());
11451143

0 commit comments

Comments
 (0)