Merge tag 'xfs-for-linus-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / x86 / kernel / fpu / init.c
index aacfd7a82cec57b9f2eb2f57e17d277a9cd74141..93982aebb39896224b28177c3212f37ca110dc70 100644 (file)
@@ -145,8 +145,8 @@ static void __init fpu__init_system_generic(void)
  * This is inherent to the XSAVE architecture which puts all state
  * components into a single, continuous memory block:
  */
-unsigned int xstate_size;
-EXPORT_SYMBOL_GPL(xstate_size);
+unsigned int fpu_kernel_xstate_size;
+EXPORT_SYMBOL_GPL(fpu_kernel_xstate_size);
 
 /* Get alignment of the TYPE. */
 #define TYPE_ALIGN(TYPE) offsetof(struct { char x; TYPE test; }, test)
@@ -178,7 +178,7 @@ static void __init fpu__init_task_struct_size(void)
         * Add back the dynamically-calculated register state
         * size.
         */
-       task_size += xstate_size;
+       task_size += fpu_kernel_xstate_size;
 
        /*
         * We dynamically size 'struct fpu', so we require that
@@ -195,7 +195,7 @@ static void __init fpu__init_task_struct_size(void)
 }
 
 /*
- * Set up the xstate_size based on the legacy FPU context size.
+ * Set up the user and kernel xstate sizes based on the legacy FPU context size.
  *
  * We set this up first, and later it will be overwritten by
  * fpu__init_system_xstate() if the CPU knows about xstates.
@@ -208,7 +208,7 @@ static void __init fpu__init_system_xstate_size_legacy(void)
        on_boot_cpu = 0;
 
        /*
-        * Note that xstate_size might be overwriten later during
+        * Note that xstate sizes might be overwritten later during
         * fpu__init_system_xstate().
         */
 
@@ -219,27 +219,17 @@ static void __init fpu__init_system_xstate_size_legacy(void)
                 */
                setup_clear_cpu_cap(X86_FEATURE_XSAVE);
                setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
-               xstate_size = sizeof(struct swregs_state);
+               fpu_kernel_xstate_size = sizeof(struct swregs_state);
        } else {
                if (boot_cpu_has(X86_FEATURE_FXSR))
-                       xstate_size = sizeof(struct fxregs_state);
+                       fpu_kernel_xstate_size =
+                               sizeof(struct fxregs_state);
                else
-                       xstate_size = sizeof(struct fregs_state);
+                       fpu_kernel_xstate_size =
+                               sizeof(struct fregs_state);
        }
-       /*
-        * Quirk: we don't yet handle the XSAVES* instructions
-        * correctly, as we don't correctly convert between
-        * standard and compacted format when interfacing
-        * with user-space - so disable it for now.
-        *
-        * The difference is small: with recent CPUs the
-        * compacted format is only marginally smaller than
-        * the standard FPU state format.
-        *
-        * ( This is easy to backport while we are fixing
-        *   XSAVES* support. )
-        */
-       setup_clear_cpu_cap(X86_FEATURE_XSAVES);
+
+       fpu_user_xstate_size = fpu_kernel_xstate_size;
 }
 
 /*