Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00bcb5ad authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Greg Kroah-Hartman
Browse files

x86/mm/32: Move setup_clear_cpu_cap(X86_FEATURE_PCID) earlier



commit b8b7abaed7a49b350f8ba659ddc264b04931d581 upstream.

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: default avatarAndy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: cba4671af755 ("x86/mm: Disable PCID on 32-bit kernels")
Link: http://lkml.kernel.org/r/b16dae9d6b0db5d9801ddbebbfd83384097c61f3.1505663533.git.luto@kernel.org


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 91b7e5cd
Loading
Loading
Loading
Loading
+0 −8
Original line number Original line Diff line number Diff line
@@ -22,14 +22,6 @@


void __init check_bugs(void)
void __init check_bugs(void)
{
{
#ifdef CONFIG_X86_32
	/*
	 * Regardless of whether PCID is enumerated, the SDM says
	 * that it can't be enabled in 32-bit mode.
	 */
	setup_clear_cpu_cap(X86_FEATURE_PCID);
#endif

	identify_boot_cpu();
	identify_boot_cpu();


	if (!IS_ENABLED(CONFIG_SMP)) {
	if (!IS_ENABLED(CONFIG_SMP)) {
+8 −0
Original line number Original line Diff line number Diff line
@@ -890,6 +890,14 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
	setup_force_cpu_bug(X86_BUG_SPECTRE_V2);
	setup_force_cpu_bug(X86_BUG_SPECTRE_V2);


	fpu__init_system(c);
	fpu__init_system(c);

#ifdef CONFIG_X86_32
	/*
	 * Regardless of whether PCID is enumerated, the SDM says
	 * that it can't be enabled in 32-bit mode.
	 */
	setup_clear_cpu_cap(X86_FEATURE_PCID);
#endif
}
}


void __init early_cpu_init(void)
void __init early_cpu_init(void)