Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Jan 2016 00:56:38 +0000 (16:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Jan 2016 00:56:38 +0000 (16:56 -0800)
Pull x86 fpu updates from Ingo Molnar:
 "This cleans up the FPU fault handling methods to be more robust, and
  moves eligible variables to .init.data"

* 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/fpu: Put a few variables in .init.data
  x86/fpu: Get rid of xstate_fault()
  x86/fpu: Add an XSTATE_OP() macro

1  2 
arch/x86/kernel/fpu/init.c

index 0d4e092ae1bf880108da881645dae1ad533cc106,e1ed5194c02aa9112828d0edfa83156c79293058..7b2978ab30df478669bbf10b2304e2fac04d1235
@@@ -12,7 -12,7 +12,7 @@@
   */
  static void fpu__init_cpu_ctx_switch(void)
  {
 -      if (!cpu_has_eager_fpu)
 +      if (!boot_cpu_has(X86_FEATURE_EAGER_FPU))
                stts();
        else
                clts();
@@@ -143,18 -143,9 +143,18 @@@ static void __init fpu__init_system_gen
  unsigned int xstate_size;
  EXPORT_SYMBOL_GPL(xstate_size);
  
 -/* Enforce that 'MEMBER' is the last field of 'TYPE': */
 +/* Get alignment of the TYPE. */
 +#define TYPE_ALIGN(TYPE) offsetof(struct { char x; TYPE test; }, test)
 +
 +/*
 + * Enforce that 'MEMBER' is the last field of 'TYPE'.
 + *
 + * Align the computed size with alignment of the TYPE,
 + * because that's how C aligns structs.
 + */
  #define CHECK_MEMBER_AT_END_OF(TYPE, MEMBER) \
 -      BUILD_BUG_ON(sizeof(TYPE) != offsetofend(TYPE, MEMBER))
 +      BUILD_BUG_ON(sizeof(TYPE) != ALIGN(offsetofend(TYPE, MEMBER), \
 +                                         TYPE_ALIGN(TYPE)))
  
  /*
   * We append the 'struct fpu' to the task_struct:
@@@ -197,7 -188,7 +197,7 @@@ static void __init fpu__init_task_struc
   */
  static void __init fpu__init_system_xstate_size_legacy(void)
  {
-       static int on_boot_cpu = 1;
+       static int on_boot_cpu __initdata = 1;
  
        WARN_ON_FPU(!on_boot_cpu);
        on_boot_cpu = 0;
@@@ -287,7 -278,7 +287,7 @@@ __setup("eagerfpu=", eager_fpu_setup)
   */
  static void __init fpu__init_system_ctx_switch(void)
  {
-       static bool on_boot_cpu = 1;
+       static bool on_boot_cpu __initdata = 1;
  
        WARN_ON_FPU(!on_boot_cpu);
        on_boot_cpu = 0;
        current_thread_info()->status = 0;
  
        /* Auto enable eagerfpu for xsaveopt */
 -      if (cpu_has_xsaveopt && eagerfpu != DISABLE)
 +      if (boot_cpu_has(X86_FEATURE_XSAVEOPT) && eagerfpu != DISABLE)
                eagerfpu = ENABLE;
  
        if (xfeatures_mask & XFEATURE_MASK_EAGER) {