From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qf8CF50vqzDq7V for ; Tue, 5 Apr 2016 10:01:13 +1000 (AEST) Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qf8CF3lpCz9sD5 for ; Tue, 5 Apr 2016 10:01:13 +1000 (AEST) Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Apr 2016 10:01:12 +1000 Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id D56453578053 for ; Tue, 5 Apr 2016 10:01:09 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u3500wU526083490 for ; Tue, 5 Apr 2016 10:01:09 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u3500Ytn004844 for ; Tue, 5 Apr 2016 10:00:34 +1000 From: Cyril Bur To: linuxppc-dev@ozlabs.org Cc: mikey@neuling.org Subject: [PATCH V2 4/5] powerpc: Move flush_all_to_thread() below save_sprs() Date: Tue, 5 Apr 2016 09:59:26 +1000 Message-Id: <1459814367-3057-4-git-send-email-cyrilbur@gmail.com> In-Reply-To: <1459814367-3057-1-git-send-email-cyrilbur@gmail.com> References: <1459814367-3057-1-git-send-email-cyrilbur@gmail.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 56444a6..7625976 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -511,23 +511,6 @@ void save_all(struct task_struct *tsk) msr_check_and_clear(msr_all_available); } -void flush_all_to_thread(struct task_struct *tsk) -{ - if (tsk->thread.regs) { - preempt_disable(); - BUG_ON(tsk != current); - save_all(tsk); - -#ifdef CONFIG_SPE - if (tsk->thread.regs->msr & MSR_SPE) - tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); -#endif - - preempt_enable(); - } -} -EXPORT_SYMBOL(flush_all_to_thread); - #ifdef CONFIG_PPC_ADV_DEBUG_REGS void do_send_trap(struct pt_regs *regs, unsigned long address, unsigned long error_code, int signal_code, int breakpt) @@ -1047,6 +1030,23 @@ static inline void restore_sprs(struct thread_struct *old_thread, #endif } +void flush_all_to_thread(struct task_struct *tsk) +{ + if (tsk->thread.regs) { + preempt_disable(); + BUG_ON(tsk != current); + save_all(tsk); + +#ifdef CONFIG_SPE + if (tsk->thread.regs->msr & MSR_SPE) + tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); +#endif + + preempt_enable(); + } +} +EXPORT_SYMBOL(flush_all_to_thread); + struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *new) { -- 2.7.4