Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760496AbcDMLnj (ORCPT ); Wed, 13 Apr 2016 07:43:39 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56724 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760461AbcDMLnf (ORCPT ); Wed, 13 Apr 2016 07:43:35 -0400 Date: Wed, 13 Apr 2016 04:42:34 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: bp@suse.de, brgerst@gmail.com, dvlasenk@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, bp@alien8.de, luto@amacapital.net, peterz@infradead.org, torvalds@linux-foundation.org Reply-To: tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, brgerst@gmail.com, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, bp@suse.de, torvalds@linux-foundation.org, peterz@infradead.org, bp@alien8.de, luto@amacapital.net In-Reply-To: <1459837795-2588-6-git-send-email-bp@alien8.de> References: <1459837795-2588-6-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/fpu: Remove check_fpu() indirection Git-Commit-ID: de82fbc3823b7b15ee03466ebfb1c5ec7cc1a941 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2045 Lines: 62 Commit-ID: de82fbc3823b7b15ee03466ebfb1c5ec7cc1a941 Gitweb: http://git.kernel.org/tip/de82fbc3823b7b15ee03466ebfb1c5ec7cc1a941 Author: Borislav Petkov AuthorDate: Tue, 5 Apr 2016 08:29:54 +0200 Committer: Ingo Molnar 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 Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1459837795-2588-6-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- 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(); -}