Thread (39 messages) flat view 39 messages, 2 authors, 2018-10-01

Re: [RFC PATCH 09/11] powerpc/tm: Do not restore default DSCR

From: Michael Neuling <hidden>
Date: 2018-09-18 05:41:21

On Wed, 2018-09-12 at 16:40 -0300, Breno Leitao wrote:
In the previous TM code, trecheckpoint was being executed in the middle o=
f
an exception, thus, DSCR was being restored to default kernel DSCR value
after trecheckpoint was done.
=20
With this current patchset, trecheckpoint is executed just before getting
to userspace, at ret_from_except_lite, for example. Thus, we do not need =
to
set default kernel DSCR value anymore, as we are leaving kernel space.  I=
t
is OK to keep the checkpointed DSCR value into the live SPR, mainly becau=
se
the transaction is doomed and it will fail soon (after RFID),=20
What if we are going back to a suspended transaction?  It will remain live =
until
userspace does a tresume
so,
continuing with the pre-checkpointed DSCR value is what seems correct.
Reading this description suggests this patch isn't really needed. Right?

Mikey
That said, we must set the DSCR value that will be used in userspace now.
Current trecheckpoint() function sets it to the pre-checkpointed value
prior to lines being changed in this patch, so, removing these lines woul=
d
keep the pre-checkpointed values.
=20
Important to say that we do not need to do the same thing with tm_reclaim=
,
quoted hunk ↗ jump to hunk
since it already set the DSCR to the default value, after TRECLAIM is
called, in the following lines:
=20
        /* Load CPU's default DSCR */
        ld      r0, PACA_DSCR_DEFAULT(r13)
        mtspr   SPRN_DSCR, r0
=20
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 arch/powerpc/kernel/tm.S | 4 ----
 1 file changed, 4 deletions(-)
=20
diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S
index 6bffbc5affe7..5427eda69846 100644
--- a/arch/powerpc/kernel/tm.S
+++ b/arch/powerpc/kernel/tm.S
@@ -493,10 +493,6 @@ restore_gprs:
 	mtlr	r0
 	ld	r2, STK_GOT(r1)
=20
-	/* Load CPU's default DSCR */
-	ld	r0, PACA_DSCR_DEFAULT(r13)
-	mtspr	SPRN_DSCR, r0
-
 	blr
=20
 	/* ****************************************************************** *=
/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help