x86/alternatives, x86/fpu: Add 'alternatives_patched' debug flag and use it in xsave_...
authorIngo Molnar <mingo@kernel.org>
Thu, 30 Apr 2015 07:09:26 +0000 (09:09 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:48:03 +0000 (15:48 +0200)
commit5e907bb0459399b0d1cc8d4c7e9f363a995b748a
tree7a0ba64607b1e538740ef6f5d6b95a91c80418fc
parent2e85591a6ca2ad84741d2859753be5497d74bd42
x86/alternatives, x86/fpu: Add 'alternatives_patched' debug flag and use it in xsave_state()

We'd like to use xsave_state() earlier, but its SYSTEM_BOOTING check
is too imprecise.

The real condition that xsave_state() would like to check is whether
alternative XSAVE instructions were patched into the kernel image
already.

Add such a (read-mostly) debug flag and use it in xsave_state().

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>
arch/x86/include/asm/alternative.h
arch/x86/include/asm/fpu/xstate.h
arch/x86/kernel/alternative.c