lkml.org 
[lkml]   [2015]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 102/208] x86/fpu: Propagate once per boot quirk into fpu__init_system_xstate()
Date
Linearize the call sequence in xsave_init():

fpu__init_system_xstate();
fpu__init_cpu_xstate();

We do this by propagating the boot-once quirk into
fpu__init_system_xstate(). fpu__init_cpu_xstate() is
safe to be called multiple time.

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: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/fpu/xsave.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/fpu/xsave.c b/arch/x86/kernel/fpu/xsave.c
index fd656cbdd315..9d5ff90916b1 100644
--- a/arch/x86/kernel/fpu/xsave.c
+++ b/arch/x86/kernel/fpu/xsave.c
@@ -652,6 +652,11 @@ static void __init init_xstate_size(void)
void fpu__init_system_xstate(void)
{
unsigned int eax, ebx, ecx, edx;
+ static bool on_boot_cpu = 1;
+
+ if (!on_boot_cpu)
+ return;
+ on_boot_cpu = 0;

if (!cpu_has_xsave) {
pr_info("x86/fpu: Legacy x87 FPU detected.\n");
@@ -714,14 +719,8 @@ void fpu__init_system_xstate(void)
*/
void xsave_init(void)
{
- static char on_boot_cpu = 1;
-
- if (on_boot_cpu) {
- on_boot_cpu = 0;
- fpu__init_system_xstate();
- } else {
- fpu__init_cpu_xstate();
- }
+ fpu__init_system_xstate();
+ fpu__init_cpu_xstate();
}

/*
--
2.1.0


\
 
 \ /
  Last update: 2015-05-05 21:01    [W:0.405 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site