aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/fpu/xstate.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-04-30 09:09:26 +0200
committerIngo Molnar <mingo@kernel.org>2015-05-19 15:48:03 +0200
commit5e907bb0459399b0d1cc8d4c7e9f363a995b748a (patch)
tree7a0ba64607b1e538740ef6f5d6b95a91c80418fc /arch/x86/include/asm/fpu/xstate.h
parentx86/fpu: Better document fpu__clear() state handling (diff)
downloadlinux-dev-5e907bb0459399b0d1cc8d4c7e9f363a995b748a.tar.xz
linux-dev-5e907bb0459399b0d1cc8d4c7e9f363a995b748a.zip
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>
Diffstat (limited to 'arch/x86/include/asm/fpu/xstate.h')
-rw-r--r--arch/x86/include/asm/fpu/xstate.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/fpu/xstate.h b/arch/x86/include/asm/fpu/xstate.h
index 31a002ad5aeb..ab2c507b58b6 100644
--- a/arch/x86/include/asm/fpu/xstate.h
+++ b/arch/x86/include/asm/fpu/xstate.h
@@ -119,7 +119,7 @@ static inline int xsave_state(struct xsave_struct *fx)
u32 hmask = mask >> 32;
int err = 0;
- WARN_ON(system_state == SYSTEM_BOOTING);
+ WARN_ON(!alternatives_patched);
/*
* If xsaves is enabled, xsaves replaces xsaveopt because