From: Cyril Bur <cyrilbur@gmail.com>
To: linuxppc-dev@ozlabs.org
Cc: mikey@neuling.org
Subject: [PATCH V2 5/5] powerpc: Preserve the SPR values across fork() syscalls
Date: Tue, 5 Apr 2016 09:59:27 +1000 [thread overview]
Message-ID: <1459814367-3057-5-git-send-email-cyrilbur@gmail.com> (raw)
In-Reply-To: <1459814367-3057-1-git-send-email-cyrilbur@gmail.com>
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 <cyrilbur@gmail.com>
---
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);
--
2.7.4
prev parent reply other threads:[~2016-04-05 0:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 23:59 [PATCH V2 1/5] selftests/powerpc: Add exec() test to check for spr sanitisation Cyril Bur
2016-04-04 23:59 ` [PATCH V2 2/5] selftests/powerpc: Add fork() test to check for spr being preserved Cyril Bur
2016-04-04 23:59 ` [PATCH V2 3/5] powerpc: Fix SPR leak across exec() syscalls Cyril Bur
2016-04-04 23:59 ` [PATCH V2 4/5] powerpc: Move flush_all_to_thread() below save_sprs() Cyril Bur
2016-04-04 23:59 ` Cyril Bur [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459814367-3057-5-git-send-email-cyrilbur@gmail.com \
--to=cyrilbur@gmail.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).