From owner-freebsd-arch Wed Feb 6 22:36:20 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rwcrmhc54.attbi.com (rwcrmhc54.attbi.com [216.148.227.87]) by hub.freebsd.org (Postfix) with ESMTP id C8F5937B423 for ; Wed, 6 Feb 2002 22:36:14 -0800 (PST) Received: from peter3.wemm.org ([12.232.27.13]) by rwcrmhc54.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020207063614.IXAQ7443.rwcrmhc54.attbi.com@peter3.wemm.org> for ; Thu, 7 Feb 2002 06:36:14 +0000 Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id g176aEs84271 for ; Wed, 6 Feb 2002 22:36:14 -0800 (PST) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id C1C9839F1; Wed, 6 Feb 2002 22:36:13 -0800 (PST) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Daniel Eischen Cc: Dan Eischen , arch@FreeBSD.ORG Subject: Re: getsetcontext system call In-Reply-To: Date: Wed, 06 Feb 2002 22:36:13 -0800 From: Peter Wemm Message-Id: <20020207063613.C1C9839F1@overcee.wemm.org> Sender: owner-freebsd-arch@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: > On Wed, 6 Feb 2002, Peter Wemm wrote: > > Daniel Eischen wrote: > > > On Wed, 6 Feb 2002, Peter Wemm wrote: > > > > Dan Eischen wrote: > > > > > > > > > Diffs are at: > > > > > > > > > > http://people.freebsd.org/~deischen/ucontext/uc-sys.diffs > > > > > http://people.freebsd.org/~deischen/ucontext/uc-libc.diffs > > > > > > [..] > > > As to set_fpregs(), it looks like it wants to convert an x87 > > > FPU state to an SSE FPU state. The opposite seems to be the > > > case for fill_fpregs(). I'm not exactly sure how and why > > > fill_fpregs() and set_fpregs() are used. Since we make struct > > > fpreg large enough to hold either x87 or SSE FPU state, do we > > > even care about converting between the two different formats > > > any longer? > > > > I think we have to, because xmm state is a superset of the x87 state, and > > we need to not f*ck up defined interface to ptrace(PT_SETFPREGS etc and > > procfs where you supply an entire 'struct fpregs' to these calls. > > OK, what if we leave struct fpreg unchanged? > > > Imagine running a 4.x binary where it does a ptrace(PT_GETFPREGS, &fpregs); > > where '&fpregs' points to the traditional sized structure. You cant just > > change the size of it without doing things like assigning new syscall numbe rs > > to ptrace(2) etc and adding some workaround glue to procfs. > > Right, I don't want to get into that now. Some time later we could > add the format specifier in struct fpreg and teach consumers how to > decipher it. How else could users of ptrace(PT_GETFPREGS, &fpregs) > know what the FP format was? If the format was included in the struct, > then they could figure out on their own which format to use. > > > We may need to do what linux does (SET/SET_FPXREGS) and maybe /proc/*/fpxre gs. > > Ugh. Anyway, I dont see that you can just change 'struct fpregs' that > > easily. The union may have to be moved up higher for x86.. > > Is it OK to leave struct fpreg unchanged for now? To be quite honest, I think that's the right thing to do for now, until it is clear what the "right" thing to do is. ptrace(2) isn't going to survive KSE unscathed, so perhaps we need an enhanced ptrace interface at some point that doesn't suffer from this kind of interface fragility. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "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-arch" in the body of the message