From patchwork Tue Oct 9 09:55:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 1569301 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8E2EADFFAD for ; Tue, 9 Oct 2012 09:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754944Ab2JIJzZ (ORCPT ); Tue, 9 Oct 2012 05:55:25 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:58194 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754900Ab2JIJzY (ORCPT ); Tue, 9 Oct 2012 05:55:24 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 64EEE8EE0DC; Tue, 9 Oct 2012 02:55:24 -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 XEvXr6p7_cAs; Tue, 9 Oct 2012 02:55:24 -0700 (PDT) Received: from [153.66.254.224] (accolon.hansenpartnership.com [46.65.52.191]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 8B0848EE0CD; Tue, 9 Oct 2012 02:55:23 -0700 (PDT) Message-ID: <1349776521.2615.54.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: Tue, 09 Oct 2012 10:55:21 +0100 In-Reply-To: <1349695707.2615.38.camel@dabdike.int.hansenpartnership.com> References: <20121004045150.GH23473@ZenIV.linux.org.uk> <1349343019.2706.3.camel@dabdike.int.hansenpartnership.com> <1349435268.3638.42.camel@dabdike.int.hansenpartnership.com> <1349444664.3638.46.camel@dabdike.int.hansenpartnership.com> <20121005144819.GO23473@ZenIV.linux.org.uk> <1349448936.3638.64.camel@dabdike.int.hansenpartnership.com> <20121005230441.GB2616@ZenIV.linux.org.uk> <1349695707.2615.38.camel@dabdike.int.hansenpartnership.com> 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 On Mon, 2012-10-08 at 12:28 +0100, James Bottomley wrote: > Even with the patch applied, it's hanging on boot around the first > kthread spawns. I'm investigating. Actually an obvious fix: you can't set up ksp and then zero the registers. I note that the stack frame you're creating is too big since THREAD_SZ_ALGN includes space for a stack frame by design so adding another one is redundant. However, this confusion seems to permeate the syscall code as well, so perhaps fixing it up later is better. With this patch applied, I can now boot up successfully to a login prompt. 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/process.c b/arch/parisc/kernel/process.c index 61113c3..38db36f 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -254,8 +254,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp, #ifdef CONFIG_HPUX extern void * const hpux_child_return; #endif - cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE; - if (unlikely(p->flags & PF_KTHREAD)) { memset(cregs, 0, sizeof(struct pt_regs)); if (!usp) /* idle thread */ @@ -265,6 +263,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp, /* Must exit via ret_from_kernel_thread in order * to call schedule_tail() */ + cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE; cregs->kpc = (unsigned long) &ret_from_kernel_thread; /* * Copy function and argument to be called from @@ -280,6 +279,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp, } else { /* user thread */ cregs->gr[30] = usp; + cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE; if (personality(p->personality) == PER_HPUX) { #ifdef CONFIG_HPUX cregs->kpc = (unsigned long) &hpux_child_return;