From: Jack Miller <jack@codezen.org>
To: linuxppc-dev@lists.ozlabs.org
Cc: michaele@au1.ibm.com, michael.neuling@au1.ibm.com
Subject: [PATCH 1/3] powerpc: Complete FSCR context switch
Date: Mon, 11 Apr 2016 13:57:43 -0500 [thread overview]
Message-ID: <1460401065-10540-2-git-send-email-jack@codezen.org> (raw)
In-Reply-To: <1460401065-10540-1-git-send-email-jack@codezen.org>
Previously we just saved the FSCR, but only restored it in some
settings, and never copied it thread to thread. This patch always
restores the FSCR and formalizes new threads inheriting its setting so
that later we can manipulate FSCR bits in start_thread.
Signed-off-by: Jack Miller <jack@codezen.org>
---
arch/powerpc/kernel/process.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index b8500b4..0c7e797 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1043,6 +1043,10 @@ static inline void restore_sprs(struct thread_struct *old_thread,
if (old_thread->tar != new_thread->tar)
mtspr(SPRN_TAR, new_thread->tar);
+
+ if (old_thread->fscr != new_thread->fscr)
+ mtspr(SPRN_FSCR, new_thread->fscr);
+
}
#endif
}
@@ -1478,6 +1482,9 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
}
if (cpu_has_feature(CPU_FTR_HAS_PPR))
p->thread.ppr = INIT_PPR;
+
+ if (cpu_has_feature(CPU_FTR_ARCH_207S))
+ p->thread.fscr = mfspr(SPRN_FSCR);
#endif
kregs->nip = ppc_function_entry(f);
return 0;
--
2.8.0
next prev parent reply other threads:[~2016-04-11 18:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-11 18:57 [RFC] P9 ldmx support Jack Miller
2016-04-11 18:57 ` Jack Miller [this message]
2016-04-12 23:42 ` [1/3] powerpc: Complete FSCR context switch Michael Ellerman
2016-04-13 10:51 ` [PATCH 1/3] " Anton Blanchard
2016-04-13 17:52 ` Jack Miller
2016-04-13 23:49 ` Michael Neuling
2016-04-14 18:39 ` Jack Miller
2016-04-14 23:11 ` Michael Neuling
2016-04-11 18:57 ` [PATCH 2/3] powerpc: Load Monitor Register Support Jack Miller
2016-04-12 5:40 ` Segher Boessenkool
2016-04-13 17:39 ` Jack Miller
2016-04-11 18:57 ` [PATCH 3/3] powerpc: Load Monitor Register Tests Jack Miller
2016-04-15 10:34 ` Madhavan Srinivasan
2016-04-12 1:05 ` [RFC] P9 ldmx support Michael Neuling
-- strict thread matches above, loose matches on Subject: below --
2016-04-18 19:07 [v2] " Jack Miller
2016-04-18 19:08 ` [PATCH 1/3] powerpc: Complete FSCR context switch Jack Miller
2016-04-18 20:47 [PATCH 2/3] powerpc: Load Monitor Register Support kbuild test robot
2016-04-18 21:08 ` [v3] P9 ldmx support Jack Miller
2016-04-18 21:08 ` [PATCH 1/3] powerpc: Complete FSCR context switch Jack Miller
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=1460401065-10540-2-git-send-email-jack@codezen.org \
--to=jack@codezen.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael.neuling@au1.ibm.com \
--cc=michaele@au1.ibm.com \
/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).