|
@@ -145,8 +145,8 @@ static void __init fpu__init_system_generic(void)
|
|
* This is inherent to the XSAVE architecture which puts all state
|
|
* This is inherent to the XSAVE architecture which puts all state
|
|
* components into a single, continuous memory block:
|
|
* 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. */
|
|
/* Get alignment of the TYPE. */
|
|
#define TYPE_ALIGN(TYPE) offsetof(struct { char x; TYPE test; }, test)
|
|
#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
|
|
* Add back the dynamically-calculated register state
|
|
* size.
|
|
* size.
|
|
*/
|
|
*/
|
|
- task_size += xstate_size;
|
|
|
|
|
|
+ task_size += fpu_kernel_xstate_size;
|
|
|
|
|
|
/*
|
|
/*
|
|
* We dynamically size 'struct fpu', so we require that
|
|
* 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 user and kernel 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
|
|
* We set this up first, and later it will be overwritten by
|
|
* fpu__init_system_xstate() if the CPU knows about xstates.
|
|
* 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;
|
|
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().
|
|
* fpu__init_system_xstate().
|
|
*/
|
|
*/
|
|
|
|
|
|
@@ -219,15 +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_XSAVE);
|
|
setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
|
|
setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
|
|
- xstate_size = sizeof(struct swregs_state);
|
|
|
|
|
|
+ fpu_kernel_xstate_size = sizeof(struct swregs_state);
|
|
} else {
|
|
} else {
|
|
if (boot_cpu_has(X86_FEATURE_FXSR))
|
|
if (boot_cpu_has(X86_FEATURE_FXSR))
|
|
- xstate_size = sizeof(struct fxregs_state);
|
|
|
|
|
|
+ fpu_kernel_xstate_size =
|
|
|
|
+ sizeof(struct fxregs_state);
|
|
else
|
|
else
|
|
- xstate_size = sizeof(struct fregs_state);
|
|
|
|
|
|
+ fpu_kernel_xstate_size =
|
|
|
|
+ sizeof(struct fregs_state);
|
|
}
|
|
}
|
|
|
|
|
|
- fpu_user_xstate_size = xstate_size;
|
|
|
|
|
|
+ fpu_user_xstate_size = fpu_kernel_xstate_size;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Quirk: we don't yet handle the XSAVES* instructions
|
|
* Quirk: we don't yet handle the XSAVES* instructions
|