Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1377823

[tip:x86/asm] x86/fpu: Remove check_fpu() indirection

From tip-bot for Borislav Petkov <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:x86/asm] x86/fpu: Remove check_fpu() indirection
Date 2016-04-13 13:50 +0200
Message-ID <rnrt0-BH-33@gated-at.bofh.it> (permalink)
References <rksOD-7th-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  de82fbc3823b7b15ee03466ebfb1c5ec7cc1a941
Gitweb:     http://git.kernel.org/tip/de82fbc3823b7b15ee03466ebfb1c5ec7cc1a941
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Tue, 5 Apr 2016 08:29:54 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 13 Apr 2016 11:37:43 +0200

x86/fpu: Remove check_fpu() indirection

Rename it to fpu__init_check_bugs() and do the CPU feature check at
entry, thus getting rid of the old fpu__init_check_bugs() wrapper.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1459837795-2588-6-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/fpu/bugs.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kernel/fpu/bugs.c b/arch/x86/kernel/fpu/bugs.c
index 224b5ec..aad34aa 100644
--- a/arch/x86/kernel/fpu/bugs.c
+++ b/arch/x86/kernel/fpu/bugs.c
@@ -21,11 +21,15 @@ static double __initdata y = 3145727.0;
  * We should really only care about bugs here
  * anyway. Not features.
  */
-static void __init check_fpu(void)
+void __init fpu__init_check_bugs(void)
 {
 	u32 cr0_saved;
 	s32 fdiv_bug;
 
+	/* kernel_fpu_begin/end() relies on patched alternative instructions. */
+	if (!boot_cpu_has(X86_FEATURE_FPU))
+		return;
+
 	/* We might have CR0::TS set already, clear it: */
 	cr0_saved = read_cr0();
 	write_cr0(cr0_saved & ~X86_CR0_TS);
@@ -59,13 +63,3 @@ static void __init check_fpu(void)
 		pr_warn("Hmm, FPU with FDIV bug\n");
 	}
 }
-
-void __init fpu__init_check_bugs(void)
-{
-	/*
-	 * kernel_fpu_begin/end() in check_fpu() relies on the patched
-	 * alternative instructions.
-	 */
-	if (boot_cpu_has(X86_FEATURE_FPU))
-		check_fpu();
-}

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] x86: Misc cleanups Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
  [PATCH 4/6] x86/tsc: Save an indentation level in recalibrate_cpu_khz() Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    Re: [PATCH 4/6] x86/tsc: Save an indentation level in  recalibrate_cpu_khz() Peter Zijlstra <peterz@infradead.org> - 2016-04-05 10:10 +0200
    [tip:x86/asm] x86/tsc: Save an indentation level in  recalibrate_cpu_khz() tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200
  [PATCH 3/6] x86/tsc: Do not check X86_FEATURE_CONSTANT_TSC in notifier call Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    Re: [PATCH 3/6] x86/tsc: Do not check X86_FEATURE_CONSTANT_TSC in  notifier call Peter Zijlstra <peterz@infradead.org> - 2016-04-05 10:10 +0200
    [tip:x86/asm] x86/tsc: Do not check X86_FEATURE_CONSTANT_TSC in  notifier call tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200
  [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    Re: [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Brian Gerst <brgerst@gmail.com> - 2016-04-05 16:00 +0200
      Re: [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Borislav Petkov <bp@alien8.de> - 2016-04-05 17:20 +0200
    [tip:x86/asm] x86/fpu/regset: Replace static_cpu_has() usage with  boot_cpu_has() tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200
  [PATCH 5/6] x86/fpu: Remove check_fpu() indirection Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    [tip:x86/asm] x86/fpu: Remove check_fpu() indirection tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200

csiph-web