linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Neuling <mikey@neuling.org>,
	linuxppc-dev@lists.ozlabs.org, Matt Evans <matt@ozlabs.org>
Subject: [PATCH 4/5] powerpc/tm: Fix return of 32bit rt signals to active transactions
Date: Fri,  7 Jun 2013 20:36:28 +1000	[thread overview]
Message-ID: <1370601390-29065-4-git-send-email-mikey@neuling.org> (raw)
In-Reply-To: <1370601390-29065-1-git-send-email-mikey@neuling.org>

Currently we only restore signals which are transactionally suspended but it's
possible that the transaction can be restored even when it's active.  Most
likely this will result in a transactional rollback by the hardware as the
transaction will have been doomed by an earlier treclaim.

The current code is a legacy of earlier kernel implementations which did
software rollback of active transactions in the kernel.  That code has now gone
but we didn't correctly fix up this part of the signals code which still makes
assumptions based on having software rollback.

This changes the signal return code to always restore both contexts on 32 bit
rt signal return.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/kernel/signal_32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index b8279b3..9e331eb 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -1245,7 +1245,7 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 		if (__get_user(msr_hi, &mcp->mc_gregs[PT_MSR]))
 			goto bad;
 
-		if (MSR_TM_SUSPENDED(msr_hi<<32)) {
+		if (MSR_TM_ACTIVE(msr_hi<<32)) {
 			/* We only recheckpoint on return if we're
 			 * transaction.
 			 */
-- 
1.7.10.4

  parent reply	other threads:[~2013-06-07 10:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 10:36 [PATCH 1/5] powerpc/tm: Fix writing top half of MSR on 32 bit signals Michael Neuling
2013-06-07 10:36 ` [PATCH 2/5] powerpc/tm: Fix 32 bit non-rt signals Michael Neuling
2013-06-09  7:25   ` Benjamin Herrenschmidt
2013-06-09 10:12     ` Michael Neuling
2013-06-07 10:36 ` [PATCH 3/5] powerpc/tm: Fix restoration of MSR on 32bit signal return Michael Neuling
2013-06-09  7:27   ` Benjamin Herrenschmidt
2013-06-09  9:56     ` Michael Neuling
2013-06-07 10:36 ` Michael Neuling [this message]
2013-06-07 10:36 ` [PATCH 5/5] powerpc/tm: Fix return of active 64bit signals Michael Neuling

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=1370601390-29065-4-git-send-email-mikey@neuling.org \
    --to=mikey@neuling.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matt@ozlabs.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).