Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 1997 10:21:43 -0700
From:      Brett Glass <brett@lariat.org>
To:        dg@root.com
Cc:        bugs@FreeBSD.ORG
Subject:   Re: Foof! bug fix? 
Message-ID:  <3.0.5.32.19971115102143.00a3d430@mail.lariat.org>
In-Reply-To: <199711150535.VAA15414@implode.root.com>
References:  <Your message of "Fri, 14 Nov 1997 17:57:37 MST."             <3.0.5.32.19971114175737.00928b90@mail.lariat.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.19971115102143.00a3d430>