From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1167712AbcKAHRA (ORCPT ); Tue, 1 Nov 2016 03:17:00 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45828 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S947649AbcKAHQ6 (ORCPT ); Tue, 1 Nov 2016 03:16:58 -0400 Date: Tue, 1 Nov 2016 00:14:20 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, brgerst@gmail.com, torvalds@linux-foundation.org, rusty@rustcorp.com.au, luto@kernel.org, dave.hansen@linux.intel.com, mingo@kernel.org, hpa@zytor.com, bp@alien8.de, peterz@infradead.org, dvlasenk@redhat.com, pbonzini@redhat.com, jpoimboe@redhat.com, kvm@vger.kernel.org, riel@redhat.com, quentin.casasnovas@oracle.com, fenghua.yu@intel.com, oleg@redhat.com Reply-To: hpa@zytor.com, mingo@kernel.org, dave.hansen@linux.intel.com, luto@kernel.org, rusty@rustcorp.com.au, torvalds@linux-foundation.org, tglx@linutronix.de, brgerst@gmail.com, linux-kernel@vger.kernel.org, oleg@redhat.com, fenghua.yu@intel.com, quentin.casasnovas@oracle.com, riel@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org, jpoimboe@redhat.com, dvlasenk@redhat.com, peterz@infradead.org, bp@alien8.de In-Reply-To: <76d1f1eacb5caead98197d1eb50ac6110ab20c6a.1477951965.git.luto@kernel.org> References: <76d1f1eacb5caead98197d1eb50ac6110ab20c6a.1477951965.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Stop saving and restoring CR0.TS in fpu__init_check_bugs() Git-Commit-ID: fc560a80bac91e512fc37cdfe03a982ef4543c6b 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 Commit-ID: fc560a80bac91e512fc37cdfe03a982ef4543c6b Gitweb: http://git.kernel.org/tip/fc560a80bac91e512fc37cdfe03a982ef4543c6b Author: Andy Lutomirski AuthorDate: Mon, 31 Oct 2016 15:18:43 -0700 Committer: Ingo Molnar CommitDate: Tue, 1 Nov 2016 07:47:53 +0100 x86/fpu: Stop saving and restoring CR0.TS in fpu__init_check_bugs() fpu__init_check_bugs() runs long after the early FPU init, so CR0.TS will be clear by the time it runs. The save-and-restore dance would have been unnecessary anyway, though, as kernel_fpu_begin() would have been good enough. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Denys Vlasenko Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Quentin Casasnovas Cc: Rik van Riel Cc: Rusty Russell Cc: Thomas Gleixner Cc: kvm list Link: http://lkml.kernel.org/r/76d1f1eacb5caead98197d1eb50ac6110ab20c6a.1477951965.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/kernel/fpu/bugs.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/arch/x86/kernel/fpu/bugs.c b/arch/x86/kernel/fpu/bugs.c index aad34aa..d913047 100644 --- a/arch/x86/kernel/fpu/bugs.c +++ b/arch/x86/kernel/fpu/bugs.c @@ -23,17 +23,12 @@ static double __initdata y = 3145727.0; */ 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); - kernel_fpu_begin(); /* @@ -56,8 +51,6 @@ void __init fpu__init_check_bugs(void) kernel_fpu_end(); - write_cr0(cr0_saved); - if (fdiv_bug) { set_cpu_bug(&boot_cpu_data, X86_BUG_FDIV); pr_warn("Hmm, FPU with FDIV bug\n");