From owner-freebsd-current Mon Sep 30 16: 2:56 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 141C637B401 for ; Mon, 30 Sep 2002 16:02:55 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71B8F43E86 for ; Mon, 30 Sep 2002 16:02:54 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id E57AF2A7D6; Mon, 30 Sep 2002 16:02:49 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Daniel Eischen Cc: current@freebsd.org Subject: Re: Longer term fix for sigreturn ABI breaking In-Reply-To: <3D98BF1A.4A58EE74@vigrid.com> Date: Mon, 30 Sep 2002 16:02:49 -0700 From: Peter Wemm Message-Id: <20020930230249.E57AF2A7D6@canning.wemm.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Daniel Eischen wrote: > At the end is a potentially longer term fix for the ABI > breakage that was introduced when the i386 mcontext_t > was changed/enlarged. > - ret = set_fpcontext(td, &ucp->uc_mcontext); > - if (ret != 0) > - return (ret); > + /* > + * Intentionally ignore the error to keep binary > + * compatibility with applications that fiddle with > + * the FPU save area in the context. The kernel > + * now saves the FPU state in the context, but it > + * gets corrupted by those applications that try > + * to work around the kernel NOT saving it. > + */ > + (void)set_fpcontext(td, &ucp->uc_mcontext); Maybe we could have something like this instead? ret = set_fpcontext(td, &ucp->uc_mcontext); #if !defined(COMPAT_FREEBSD4) && !defined(COMPAT_43) if (ret != 0) return (ret); #endif ie: ignore the error only if we have to be compatable. Longer term, I was thining that we could/should do what sparc64 does, ie: libc provides the trampoline and it can then call the correct sigreturn syscall. That means we add a new sigreturn syscall each time we significantly break the sigreturn ABI (as in this case) and applications will be able to use the correct one. Paired with a new sigaction syscall which would specify the "new" context format we can then be future proof. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message