/*
* Enable and initialize the xsave feature.
+ *
+ * ( Not marked __init because of false positive section warnings
+ * generated by xsave_init(). )
*/
-static void __init xstate_enable_boot_cpu(void)
+static void /* __init */ xstate_enable_boot_cpu(void)
{
unsigned int eax, ebx, ecx, edx;
/*
* For the very first instance, this calls xstate_enable_boot_cpu();
* for all subsequent instances, this calls xstate_enable().
- *
- * This is somewhat obfuscated due to the lack of powerful enough
- * overrides for the section checks.
*/
void xsave_init(void)
{
- static __refdata void (*next_func)(void) = xstate_enable_boot_cpu;
- void (*this_func)(void);
+ static char on_boot_cpu = 1;
if (!cpu_has_xsave)
return;
- this_func = next_func;
- next_func = xstate_enable;
- this_func();
+ if (on_boot_cpu) {
+ on_boot_cpu = 0;
+ xstate_enable_boot_cpu();
+ } else {
+ xstate_enable();
+ }
}
/*