From patchwork Mon Apr 4 23:59:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 606195 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qf8H63BZtz9s4x for ; Tue, 5 Apr 2016 10:04:34 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qf8H62NZKzDqgC for ; Tue, 5 Apr 2016 10:04:34 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org 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 3qf8CF5sQ8zDq8w for ; Tue, 5 Apr 2016 10:01:13 +1000 (AEST) Received: by ozlabs.org (Postfix) id 3qf8CF540Dz9sD5; Tue, 5 Apr 2016 10:01:13 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org 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 3qf8CF4NX4z9sD9 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:13 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Apr 2016 10:01:10 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: cyrilbur@gmail.com X-IBM-RcptTo: linuxppc-dev@ozlabs.org Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 20B312CE8054 for ; Tue, 5 Apr 2016 10:01:10 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u3500x4Q21823730 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 u3500YEs004834 for ; Tue, 5 Apr 2016 10:00:34 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u3500XOc004073; Tue, 5 Apr 2016 10:00:33 +1000 Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 75B89A0247; Tue, 5 Apr 2016 10:00:09 +1000 (AEST) From: Cyril Bur To: linuxppc-dev@ozlabs.org Subject: [PATCH V2 5/5] powerpc: Preserve the SPR values across fork() syscalls Date: Tue, 5 Apr 2016 09:59:27 +1000 Message-Id: <1459814367-3057-5-git-send-email-cyrilbur@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1459814367-3057-1-git-send-email-cyrilbur@gmail.com> References: <1459814367-3057-1-git-send-email-cyrilbur@gmail.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16040500-0021-0000-0000-000003617656 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikey@neuling.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Currently copy_thread() doesn't flush SPRs to the parent thread struct. Currently this only affects the TAR register as perf takes care of some of the others and the remaining ones are all Event Based Branch (EBB) registers which are cleared across fork(). Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 7625976..892c76d 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1037,6 +1037,8 @@ void flush_all_to_thread(struct task_struct *tsk) BUG_ON(tsk != current); save_all(tsk); + save_sprs(&tsk->thread); + #ifdef CONFIG_SPE if (tsk->thread.regs->msr & MSR_SPE) tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);