From owner-freebsd-alpha Thu Feb 24 0:55:15 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by hub.freebsd.org (Postfix) with ESMTP id 63D1F37BBA9 for ; Thu, 24 Feb 2000 00:55:07 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by anchor-post-30.mail.demon.net with esmtp (Exim 2.12 #1) id 12Nu2z-000JOt-0U; Thu, 24 Feb 2000 08:54:57 +0000 Received: from tecra.nlsystems.com (tecra [10.0.0.5]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id IAA88823; Thu, 24 Feb 2000 08:57:46 GMT (envelope-from dfr@nlsystems.com) Date: Thu, 24 Feb 2000 08:57:39 +0000 (GMT) From: Doug Rabson To: John Polstra Cc: alpha@freebsd.org Subject: Re: pcb_onfault bug on alpha? In-Reply-To: <200002240707.XAA39208@vashon.polstra.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, 23 Feb 2000, John Polstra wrote: > In article , > Doug Rabson wrote: > > > This fix looks good. > > I thought so too, but it gave me an instant unaligned access panic > when I ran my test case against it. Here again is the code: > > LEAF(copyerr, 0) > LDGP(pv) > ldq ra, (16-8)(sp) /* restore ra. */ > lda sp, 16(sp) /* kill stack frame. */ > ldq t0, curproc > ldq t0, P_ADDR(t0) > stq zero, U_PCB_ONFAULT(t0) /* reset fault handler. */ > ldiq v0, EFAULT /* return EFAULT. */ > RET > END(copyerr) > > It is dying on the "ldq t0, curproc". I have a feeling the GP > register is wrong at that point. A0 (which usually contains the > faulting address) is not equal to curproc, and it is in fact unaligned > for a 64-bit load. I noticed that the other fault handler (fusufault) > doesn't have a LDGP(pv) at its beginning. Any ideas? I'm close to > the limit of my knowledge of the Alpha register usage conventions. The LDGP(pv) part is wrong. This only correctly loads the gp if pv contains the function address (true after a call using the standard calling conventions). Since gp will already be setup to the kernel's GOT, I think this instruction should be removed. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message