aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/fpu/xstate.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-04-30 11:07:06 +0200
committerIngo Molnar <mingo@kernel.org>2015-05-19 15:48:07 +0200
commit6f57502310c85b60bdea78228e9b5bb3e82dc3b7 (patch)
treeb6a5e53387722e161588d85ef0df2c5a3aa1fa37 /arch/x86/include/asm/fpu/xstate.h
parentx86/fpu: Create 'union thread_xstate' helper for fpstate_init() (diff)
downloadlinux-dev-6f57502310c85b60bdea78228e9b5bb3e82dc3b7.tar.xz
linux-dev-6f57502310c85b60bdea78228e9b5bb3e82dc3b7.zip
x86/fpu: Generalize 'init_xstate_ctx'
So the handling of init_xstate_ctx has a layering violation: both 'struct xsave_struct' and 'union thread_xstate' have a 'struct i387_fxsave_struct' member: xsave_struct::i387 thread_xstate::fxsave The handling of init_xstate_ctx is generic, it is used on all CPUs, with or without XSAVE instruction. So it's confusing how the generic code passes around and handles an XSAVE specific format. What we really want is for init_xstate_ctx to be a proper fpstate and we use its ::fxsave and ::xsave members, as appropriate. Since the xsave_struct::i387 and thread_xstate::fxsave aliases each other this is not a functional problem. So implement this, and move init_xstate_ctx to the generic FPU code in the process. Also, since init_xstate_ctx is not XSAVE specific anymore, rename it to init_fpstate, and mark it __read_mostly, because it's only modified once during bootup, and used as a reference fpstate later on. There's no change in functionality. 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.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/x86/include/asm/fpu/xstate.h b/arch/x86/include/asm/fpu/xstate.h
index afd21329c585..3051280887b8 100644
--- a/arch/x86/include/asm/fpu/xstate.h
+++ b/arch/x86/include/asm/fpu/xstate.h
@@ -37,7 +37,6 @@
extern unsigned int xstate_size;
extern u64 xfeatures_mask;
extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
-extern struct xsave_struct init_xstate_ctx;
extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);