linux-alpha.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: LKML <linux-kernel@vger.kernel.org>, linux-alpha@vger.kernel.org
Subject: [PATCH 2/2] alpha: Make sys_getxpid() call do_getppid()
Date: Sun, 26 Sep 2010 16:13:11 +0100	[thread overview]
Message-ID: <1285513991.2697.262.camel@localhost> (raw)
In-Reply-To: <1285513774.2697.255.camel@localhost>

sys_getxpid() was not following RCU protocol or considering namespace
visibility for the parent pid.  Change it to call do_geptpid() which
does the right thing.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
This is totally untested, and I've never written Alpha assembly before,
so this definitely needs review and testing by an Alpha porter.

I've left the shortcut tgid lookup there as I assume it is still valid.

Ben.

 arch/alpha/kernel/entry.S |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index ab1ee0a..5b1bc48 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -857,24 +857,15 @@ sys_getxgid:
 	.globl	sys_getxpid
 	.ent	sys_getxpid
 sys_getxpid:
+	lda	$sp, -16($sp)
+	stq	$26, 0($sp)
 	.prologue 0
+	jsr	$26, do_getppid
+	ldq	$26, 0($sp)
+	lda	$sp, 16($sp)
+	stq	$0, 80($sp)
 	ldq	$2, TI_TASK($8)
-
-	/* See linux/kernel/timer.c sys_getppid for discussion
-	   about this loop.  */
-	ldq	$3, TASK_GROUP_LEADER($2)
-	ldq	$4, TASK_REAL_PARENT($3)
 	ldl	$0, TASK_TGID($2)
-1:	ldl	$1, TASK_TGID($4)
-#ifdef CONFIG_SMP
-	mov	$4, $5
-	mb
-	ldq	$3, TASK_GROUP_LEADER($2)
-	ldq	$4, TASK_REAL_PARENT($3)
-	cmpeq	$4, $5, $5
-	beq	$5, 1b
-#endif
-	stq	$1, 80($sp)
 	ret
 .end sys_getxpid
 
-- 
1.7.1



  reply	other threads:[~2010-09-26 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-26 15:09 [PATCH 1/2] syscall,pid: Extract bodies of sys_get{pid,ppid}() into do_get{pid,ppid}() Ben Hutchings
2010-09-26 15:13 ` Ben Hutchings [this message]
2010-09-26 22:28   ` [PATCH 2/2] alpha: Make sys_getxpid() call do_getppid() Al Viro
2010-09-26 22:34     ` Ben Hutchings

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=1285513991.2697.262.camel@localhost \
    --to=ben@decadent.org.uk \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).