Skip to content

Commit b8b7aba

Browse files
amlutoIngo Molnar
authored andcommitted
x86/mm/32: Move setup_clear_cpu_cap(X86_FEATURE_PCID) earlier
Otherwise we might have the PCID feature bit set during cpu_init(). This is just for robustness. I haven't seen any actual bugs here. Signed-off-by: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: cba4671 ("x86/mm: Disable PCID on 32-bit kernels") Link: http://lkml.kernel.org/r/b16dae9d6b0db5d9801ddbebbfd83384097c61f3.1505663533.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
1 parent 52a2af4 commit b8b7aba

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@
2121

2222
void __init check_bugs(void)
2323
{
24-
#ifdef CONFIG_X86_32
25-
/*
26-
* Regardless of whether PCID is enumerated, the SDM says
27-
* that it can't be enabled in 32-bit mode.
28-
*/
29-
setup_clear_cpu_cap(X86_FEATURE_PCID);
30-
#endif
31-
3224
identify_boot_cpu();
3325

3426
if (!IS_ENABLED(CONFIG_SMP)) {

arch/x86/kernel/cpu/common.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,14 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
904904

905905
setup_force_cpu_cap(X86_FEATURE_ALWAYS);
906906
fpu__init_system(c);
907+
908+
#ifdef CONFIG_X86_32
909+
/*
910+
* Regardless of whether PCID is enumerated, the SDM says
911+
* that it can't be enabled in 32-bit mode.
912+
*/
913+
setup_clear_cpu_cap(X86_FEATURE_PCID);
914+
#endif
907915
}
908916

909917
void __init early_cpu_init(void)

0 commit comments

Comments
 (0)