mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 05:04:20 +00:00
x86/fpu: Remove xsave_init() __init obfuscation
So this code surprised me - and being surprised when reading FPU code does not help maintainability of an already overly complex subsystem. Remove the obfuscation and just don't use __init annotation for now. Anyone who wants to free these ~600 bytes of xstate_enable_boot_cpu() should implement it cleanly. Reviewed-by: Borislav Petkov <bp@alien8.de> Cc: Andy Lutomirski <luto@amacapital.net> 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>
This commit is contained in:
parent
df6397525c
commit
c0841e34fd
1 changed files with 11 additions and 9 deletions
|
@ -606,8 +606,11 @@ static void __init init_xstate_size(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable and initialize the xsave feature.
|
* 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;
|
unsigned int eax, ebx, ecx, edx;
|
||||||
|
|
||||||
|
@ -663,21 +666,20 @@ static void __init xstate_enable_boot_cpu(void)
|
||||||
/*
|
/*
|
||||||
* For the very first instance, this calls xstate_enable_boot_cpu();
|
* For the very first instance, this calls xstate_enable_boot_cpu();
|
||||||
* for all subsequent instances, this calls xstate_enable().
|
* 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)
|
void xsave_init(void)
|
||||||
{
|
{
|
||||||
static __refdata void (*next_func)(void) = xstate_enable_boot_cpu;
|
static char on_boot_cpu = 1;
|
||||||
void (*this_func)(void);
|
|
||||||
|
|
||||||
if (!cpu_has_xsave)
|
if (!cpu_has_xsave)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this_func = next_func;
|
if (on_boot_cpu) {
|
||||||
next_func = xstate_enable;
|
on_boot_cpu = 0;
|
||||||
this_func();
|
xstate_enable_boot_cpu();
|
||||||
|
} else {
|
||||||
|
xstate_enable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue