From owner-freebsd-bugs Sat Nov 15 09:22:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA19349 for bugs-outgoing; Sat, 15 Nov 1997 09:22:03 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: from lariat.lariat.org (ppp1000.lariat.org@lariat.lariat.org [129.72.251.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id JAA19341 for ; Sat, 15 Nov 1997 09:21:55 -0800 (PST) (envelope-from brett@lariat.org) Received: (from brett@localhost) by lariat.lariat.org (8.8.8/8.8.8) id KAA05766; Sat, 15 Nov 1997 10:14:31 -0700 (MST) Message-Id: <3.0.5.32.19971115102143.00a3d430@mail.lariat.org> X-Sender: brett@mail.lariat.org X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Sat, 15 Nov 1997 10:21:43 -0700 To: dg@root.com From: Brett Glass Subject: Re: Foof! bug fix? Cc: bugs@FreeBSD.ORG In-Reply-To: <199711150535.VAA15414@implode.root.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Jonathan Lemon Wrote: >IMHO, the "take page fault on any trapno < 7" solution is a very ugly >hack, but it got me thinking about a better way to solve this. The >solution seems to depend on the fact that a page fault has a higher >priority than an illegal instruction fault, and thus, if both are posted >first, then the page fault takes precedence. > >This made me think that there might be other faults that also have higher >precedence than the illegal instruction fault, and which could be localized >to just the #UD handler. It turns out that exceeding the segment limit >is one of them. > >My ``fix'' is to have the IDT descriptor reference a segemnt which has >a length of 0. This has the effect of mapping SIGILL into SIGBUS, so that >the `cmpxchg8' crash now generates a Bus error. (I didn't bother returning >the correct signal; it can probably be added if it is important) The main thing to watch for, in this case, is the potential for yet other faults. Intel probably recommended a page fault because it supercedes EVERYTHING, making it pretty darn safe. But if a segment fault is used instead, will there ever be a situation where (a) a multiple fault occurs, or (b) something supercedes the segment fault or interferes with its processing? I don't have my Intel manuals right here, so I'm not able to work though all of the arcane possibilities. --Brett