From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 30 16:34:35 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62B0216A4DE for ; Sun, 30 Jul 2006 16:34:35 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from outmx011.isp.belgacom.be (outmx011.isp.belgacom.be [195.238.5.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0EFE43D53 for ; Sun, 30 Jul 2006 16:34:34 +0000 (GMT) (envelope-from tijl@ulyssis.org) Received: from outmx011.isp.belgacom.be (localhost [127.0.0.1]) by outmx011.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k6UGYQV9004532 for ; Sun, 30 Jul 2006 18:34:27 +0200 (envelope-from ) Received: from kalimero.kotnet.org (64.211-245-81.adsl-dyn.isp.belgacom.be [81.245.211.64]) by outmx011.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k6UGYIrW004462; Sun, 30 Jul 2006 18:34:18 +0200 (envelope-from ) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.13.6/8.13.6) with ESMTP id k6UGYHKR010674; Sun, 30 Jul 2006 18:34:17 +0200 (CEST) (envelope-from tijl@ulyssis.org) From: Tijl Coosemans To: kmacy@fsmware.com Date: Sun, 30 Jul 2006 18:34:11 +0200 User-Agent: KMail/1.9.3 References: <200607292110.37733.tijl@ulyssis.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5604069.S5Bz4dlXLo"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200607301834.16657.tijl@ulyssis.org> Cc: freebsd-hackers@freebsd.org Subject: Re: i386 page fault clobbers error code in trap frame X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jul 2006 16:34:35 -0000 --nextPart5604069.S5Bz4dlXLo Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 29 July 2006 21:57, Kip Macy wrote: > Looking at siginfo it isn't clear that there is a "right way" to > provide SIGSEGV, eva, and the error code. > > _fault._trapno should contain the machine's error code and si_signo > should contain SIGSEGV, and si_addr contains the faulting pc. Maybe > one could abuse si_code to contain eva. Sorry for asking a question > that has already been answered but where is eva being put currently? si_addr doesn't contain the faulting pc, it contains the address that=20 caused the page fault (i.e. eva). pc at the time of the fault is stored=20 in the sigcontext as sc_eip. But siginfo is ok. The problem is in sigcontext (mostly a copy of=20 trapframe), where sc_err is incorrect. However, it appears that all the=20 relevant code has changed significantly in CURRENT to the point that=20 the offending line can simply be removed. It would be nice if somebody=20 could review/verify/test this, because I don't have CURRENT installed=20 at the moment. =2D-- sys/i386/i386/trap.c.orig Sun Jul 30 18:27:21 2006 +++ sys/i386/i386/trap.c Sun Jul 30 18:27:56 2006 @@ -777,9 +777,6 @@ return (-1); } =2D /* kludge to pass faulting virtual address to sendsig */ =2D frame->tf_err =3D eva; =2D return((rv =3D=3D KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); } --nextPart5604069.S5Bz4dlXLo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQBEzN+IdMR2xnarec8RAsHKAKDHdOFNszIR4mgbUfzx2kthR3N9eACgrKmR 4deLo0S9sYFtD4DegfegMFA= =x1wM -----END PGP SIGNATURE----- --nextPart5604069.S5Bz4dlXLo--