From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753734AbbCNK6e (ORCPT ); Sat, 14 Mar 2015 06:58:34 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44882 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896AbbCNK6c (ORCPT ); Sat, 14 Mar 2015 06:58:32 -0400 Date: Sat, 14 Mar 2015 11:57:02 +0100 From: Borislav Petkov To: Oleg Nesterov Cc: Dave Hansen , Ingo Molnar , Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: [PATCH] x86/fpu: Fold __drop_fpu() into its sole user Message-ID: <20150314105702.GC3114@pd.tnic> References: <54F74F59.5070107@intel.com> <20150311173346.GB5032@redhat.com> <20150311173507.GF5032@redhat.com> <20150313173030.GA31217@redhat.com> <20150314105502.GB3114@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150314105502.GB3114@pd.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fold it into drop_fpu(). Phew, one less FPU function to pay attention to. No functionality change. Signed-off-by: Borislav Petkov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Pekka Riikonen Cc: Rik van Riel Cc: Suresh Siddha Cc: Fenghua Yu Cc: Quentin Casasnovas Cc: Dave Hansen Cc: Ingo Molnar --- arch/x86/include/asm/fpu-internal.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 7d2f7fa6b2dd..2d4adff428ac 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h @@ -378,8 +378,14 @@ static inline void __thread_fpu_begin(struct task_struct *tsk) __thread_set_has_fpu(tsk); } -static inline void __drop_fpu(struct task_struct *tsk) +static inline void drop_fpu(struct task_struct *tsk) { + /* + * Forget coprocessor state.. + */ + preempt_disable(); + tsk->thread.fpu_counter = 0; + if (__thread_has_fpu(tsk)) { /* Ignore delayed exceptions from user space */ asm volatile("1: fwait\n" @@ -387,16 +393,7 @@ static inline void __drop_fpu(struct task_struct *tsk) _ASM_EXTABLE(1b, 2b)); __thread_fpu_end(tsk); } -} -static inline void drop_fpu(struct task_struct *tsk) -{ - /* - * Forget coprocessor state.. - */ - preempt_disable(); - tsk->thread.fpu_counter = 0; - __drop_fpu(tsk); clear_stopped_child_used_math(tsk); preempt_enable(); } -- 2.3.3 -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --