Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62db6871 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86/fpu: Propagate once per boot quirk into fpu__init_system_xstate()



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: default avatarBorislav 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: default avatarIngo Molnar <mingo@kernel.org>
parent e9dbfd67
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -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,15 +719,9 @@ 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();
}
}

/*
 * setup_init_fpu_buf() is __init and it is OK to call it here because