public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Ingo Molnar <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, torvalds@linux-foundation.org,
	hpa@zytor.com, tglx@linutronix.de, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, umgwanakikbuti@gmail.com,
	mingo@kernel.org, bp@alien8.de
Subject: [tip:x86/urgent] x86/fpu: Fix FPU related boot regression when CPUID masking BIOS feature is enabled
Date: Mon, 29 Jun 2015 22:24:38 -0700	[thread overview]
Message-ID: <tip-db52ef74b35dcb91fd154fa52c618bdd1b90e28e@git.kernel.org> (raw)
In-Reply-To: <20150627082514.GA10894@gmail.com>

Commit-ID:  db52ef74b35dcb91fd154fa52c618bdd1b90e28e
Gitweb:     http://git.kernel.org/tip/db52ef74b35dcb91fd154fa52c618bdd1b90e28e
Author:     Ingo Molnar <mingo@kernel.org>
AuthorDate: Sat, 27 Jun 2015 10:25:14 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 30 Jun 2015 07:22:10 +0200

x86/fpu: Fix FPU related boot regression when CPUID masking BIOS feature is enabled

Mike Galbraith reported:

  " My i7-4790 box is having one hell of a time with this merge
    window, dead in the water.

    BIOS setting "Limit CPUID Maximum" upsets new fpu code
    mightily. "

It turns out that Linux does a double workaround here, as per:

  066941bd4eeb ("x86: unmask CPUID levels on Intel CPUs")

it undoes the BIOS workaround - but as a side effect the CPUID
state is not completely constant during early init anymore,
and the new FPU init code did not take this into account.

So what happened is that the xstate init code did not have full
CPUID available, which broke subsequent attempts to use xstate
features.

Fix this by ordering the early FPU init code to after we've
stabilized the CPUID state.

Reported-bisected-and-tested-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20150627082514.GA10894@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 9fc5e3d..922c5e0 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -742,7 +742,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 	cpu_detect(c);
 	get_cpu_vendor(c);
 	get_cpu_cap(c);
-	fpu__init_system(c);
 
 	if (this_cpu->c_early_init)
 		this_cpu->c_early_init(c);
@@ -754,6 +753,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 		this_cpu->c_bsp_init(c);
 
 	setup_force_cpu_cap(X86_FEATURE_ALWAYS);
+	fpu__init_system(c);
 }
 
 void __init early_cpu_init(void)

  parent reply	other threads:[~2015-06-30  5:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-27  6:25 regression: massive trouble with fpu rework Mike Galbraith
2015-06-27  8:18 ` [all better] " Mike Galbraith
2015-06-27  8:25   ` Ingo Molnar
2015-06-27  8:55     ` Mike Galbraith
2015-06-27  9:37       ` Borislav Petkov
2015-06-27 11:01         ` Mike Galbraith
2015-06-27 21:02       ` Henrique de Moraes Holschuh
2015-06-28  3:11         ` Mike Galbraith
2015-06-28 15:06           ` Henrique de Moraes Holschuh
2015-06-28 15:39             ` Mike Galbraith
2015-06-29  1:12               ` Henrique de Moraes Holschuh
2015-06-29  6:40       ` Ingo Molnar
2015-06-29  8:25         ` Mike Galbraith
2015-06-29  8:33           ` Borislav Petkov
2015-06-29  8:41             ` Mike Galbraith
2015-06-29  9:35             ` Ingo Molnar
2015-06-29  9:57               ` Borislav Petkov
2015-06-29 19:48               ` H. Peter Anvin
2015-06-30  5:14                 ` Ingo Molnar
2015-06-29 12:27             ` Mike Galbraith
2015-06-29 13:09               ` Borislav Petkov
2015-06-30  5:16                 ` Ingo Molnar
2015-06-30 20:22                   ` H. Peter Anvin
2015-07-09 13:13                   ` Henrique de Moraes Holschuh
2015-06-29 19:50         ` H. Peter Anvin
2015-06-30  5:18           ` Ingo Molnar
2015-06-30  5:24     ` tip-bot for Ingo Molnar [this message]
2015-06-27  8:18 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-db52ef74b35dcb91fd154fa52c618bdd1b90e28e@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=umgwanakikbuti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox