From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Parisc List <linux-parisc@vger.kernel.org>
Subject: Re: what's parisc execve_wrapper doing in the end?
Date: Thu, 04 Oct 2012 11:02:16 +0100 [thread overview]
Message-ID: <1349344936.2706.10.camel@dabdike.int.hansenpartnership.com> (raw)
In-Reply-To: <20121004051359.GA24664@ZenIV.linux.org.uk>
[cc: parisc list]
On Thu, 2012-10-04 at 06:13 +0100, Al Viro wrote:
> On Thu, Oct 04, 2012 at 05:51:50AM +0100, Al Viro wrote:
> > I'm really confused by that one:
> > /* If exec succeeded we need to load the args */
> >
> > ldo -1024(%r0),%r1
> > cmpb,>>= %r28,%r1,error_\execve
> > copy %r2,%r19
> >
> > error_\execve:
> > bv %r0(%r19)
> >
> > Just what is going on there? That cmpb is non-nullifying, right? So this
> > assignment to %r2 happens whether condition is true or false. And AFAICS
> > IAOQ_Next is set to error_\execve in both cases. So what the hell
> > is that comparison for (and the comment about)? Why not simply return
> > via bv %r0(%r2) and be done with that? It had been done that way since
> > the initial parisc merge circa 2.4.0-test*...
>
> FWIW, I suspect that hpux_execve_wrapper might have something to do with it -
> there we have
> comb,>>= %r28,%r1,exec_error
> copy %r2,%r19
> ldo -TASK_SZ_ALGN-64(%r30),%r1 ;! get task ptr
> LDREG TASK_PT_GR26(%r1),%r26
> LDREG TASK_PT_GR25(%r1),%r25
> LDREG TASK_PT_GR24(%r1),%r24
> LDREG TASK_PT_GR23(%r1),%r23
> copy %r0,%r2 /* Flag to syscall_exit not to clear args */
>
> exec_error:
> instead and that at least makes some sense (even though I don't see
> why syscall_exit would fail to restore them or would check %r2). Is
> the execve_wrapper a rudiment of something similar? It's beyond the
> history observable in the mainline, unfortunately... ;-/
It's plausible. I just verified the theory that the branch is redundant
by successfully booting with this patch applied.
James
---
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 18670a0..d1da93f 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -1893,15 +1893,7 @@ ENDPROC(sys_vfork_wrapper)
ldo -FRAME_SIZE(%r30),%r30
LDREG -RP_OFFSET(%r30),%r2
-
- /* If exec succeeded we need to load the args */
-
- ldo -1024(%r0),%r1
- cmpb,>>= %r28,%r1,error_\execve
- copy %r2,%r19
next prev parent reply other threads:[~2012-10-04 10:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20121004045150.GH23473@ZenIV.linux.org.uk>
2012-10-04 9:30 ` what's parisc execve_wrapper doing in the end? James Bottomley
2012-10-05 11:07 ` James Bottomley
2012-10-05 13:44 ` James Bottomley
2012-10-05 14:47 ` James Bottomley
2012-10-05 14:48 ` Al Viro
2012-10-05 14:55 ` James Bottomley
2012-10-05 19:21 ` Al Viro
2012-10-05 23:04 ` Al Viro
2012-10-08 11:28 ` James Bottomley
2012-10-09 9:55 ` James Bottomley
2012-10-10 4:26 ` Al Viro
2012-10-05 22:54 ` John David Anglin
2012-10-05 23:32 ` Al Viro
2012-10-06 0:15 ` John David Anglin
[not found] ` <20121004051359.GA24664@ZenIV.linux.org.uk>
2012-10-04 10:02 ` James Bottomley [this message]
2012-10-04 12:22 ` Al Viro
2012-10-04 12:57 ` James Bottomley
2012-10-04 13:30 ` Carlos O'Donell
2012-10-04 14:07 ` Al Viro
2012-10-05 0:00 ` John David Anglin
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=1349344936.2706.10.camel@dabdike.int.hansenpartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-parisc@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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