From owner-freebsd-current Mon Aug 31 16:53:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA04142 for freebsd-current-outgoing; Mon, 31 Aug 1998 16:53:33 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA04137 for ; Mon, 31 Aug 1998 16:53:31 -0700 (PDT) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id QAA24142; Mon, 31 Aug 1998 16:52:12 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp03.primenet.com, id smtpd024046; Mon Aug 31 16:52:08 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id QAA13074; Mon, 31 Aug 1998 16:51:54 -0700 (MST) From: Terry Lambert Message-Id: <199808312351.QAA13074@usr01.primenet.com> Subject: Re: Floating Point Exceptions, signal handlers & subsequent ops To: bde@zeta.org.au (Bruce Evans) Date: Mon, 31 Aug 1998 23:51:53 +0000 (GMT) Cc: bde@zeta.org.au, cracauer@cons.org, tlambert@primenet.com, current@FreeBSD.ORG, luoqi@watermarkgroup.com, shocking@prth.pgs.com In-Reply-To: <199808310359.NAA27283@godzilla.zeta.org.au> from "Bruce Evans" at Aug 31, 98 01:59:21 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > TSS-based context switching > doesn't affect the FPU. I believe Linux uses TSS-based context switching > for the CPU and fully lazy context switching for the FPU. Thanks for the correction... > >I don't understand how not saving the registers could lead to an FPE > >delivered to the wrong process. A process could only leave with > >pending exceptions if it used floating point and in that case its > >registers would have been saved. > > Well, on old86's with a coprocessor, and on new86's with a coprocessor > but still using IRQ13 to report exceptions, the save-context FPU > instructions don't actually work if there is a trap pending - they > cause a trap in the context of the new process. Half of the code > and most of the complications in npx.c are for ignoring this trap. > It occurs instead on the next FPU instruction for the old process, > even that instruction is a control instruction that shouldn't trap. What Bruce said. 8-). I'm very glad I didn't have to dig into the code to answer this for you; realistically, I probably would have punted with "something to do with IRQ13 and the register save kicking a trap in the new process that has to be stored for the old". Now that Bruce is "in the groove"... fully lazy switching? ;-). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message