diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-05-05 11:34:49 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 15:48:12 +0200 |
commit | e97131a8391e9fce5126ed54dc66c9d8965d3b4e (patch) | |
tree | 8e1db79ae5c956db9a329ed1d76891d7c12535fd /arch/x86/kernel/fpu/init.c | |
parent | d364a7656c1855c940dfa4baf4ebcc3c6a9e6fd2 (diff) | |
download | op-kernel-dev-e97131a8391e9fce5126ed54dc66c9d8965d3b4e.zip op-kernel-dev-e97131a8391e9fce5126ed54dc66c9d8965d3b4e.tar.gz |
x86/fpu: Add CONFIG_X86_DEBUG_FPU=y FPU debugging code
There are various internal FPU state debugging checks that never
trigger in practice, but which are useful for FPU code development.
Separate these out into CONFIG_X86_DEBUG_FPU=y, and also add a
couple of new ones.
The size difference is about 0.5K of code on defconfig:
text data bss filename
15028906 2578816 1638400 vmlinux
15029430 2578816 1638400 vmlinux
( Keep this enabled by default until the new FPU code is debugged. )
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/fpu/init.c')
-rw-r--r-- | arch/x86/kernel/fpu/init.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index a9e506a..e9f1d6e 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -143,6 +143,11 @@ EXPORT_SYMBOL_GPL(xstate_size); */ static void __init fpu__init_system_xstate_size_legacy(void) { + static int on_boot_cpu = 1; + + WARN_ON_FPU(!on_boot_cpu); + on_boot_cpu = 0; + /* * Note that xstate_size might be overwriten later during * fpu__init_system_xstate(). @@ -214,7 +219,12 @@ __setup("eagerfpu=", eager_fpu_setup); */ static void __init fpu__init_system_ctx_switch(void) { - WARN_ON(current->thread.fpu.fpstate_active); + static bool on_boot_cpu = 1; + + WARN_ON_FPU(!on_boot_cpu); + on_boot_cpu = 0; + + WARN_ON_FPU(current->thread.fpu.fpstate_active); current_thread_info()->status = 0; /* Auto enable eagerfpu for xsaveopt */ |