From patchwork Thu Oct 4 10:02:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 1545851 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 72A953FC1A for ; Thu, 4 Oct 2012 10:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107Ab2JDKCU (ORCPT ); Thu, 4 Oct 2012 06:02:20 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:48182 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751925Ab2JDKCT (ORCPT ); Thu, 4 Oct 2012 06:02:19 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 349D68EE0E6; Thu, 4 Oct 2012 03:02:19 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4N3m23Ip_qFf; Thu, 4 Oct 2012 03:02:19 -0700 (PDT) Received: from [153.66.254.224] (accolon.hansenpartnership.com [87.194.65.0]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 55C6E8EE0CE; Thu, 4 Oct 2012 03:02:18 -0700 (PDT) Message-ID: <1349344936.2706.10.camel@dabdike.int.hansenpartnership.com> Subject: Re: what's parisc execve_wrapper doing in the end? From: James Bottomley To: Al Viro Cc: Parisc List Date: Thu, 04 Oct 2012 11:02:16 +0100 In-Reply-To: <20121004051359.GA24664@ZenIV.linux.org.uk> References: <20121004045150.GH23473@ZenIV.linux.org.uk> <20121004051359.GA24664@ZenIV.linux.org.uk> X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org [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 --- -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 - -error_\execve: - bv %r0(%r19) + bv %r0(%r2) nop .endm