From owner-freebsd-hackers Fri Nov 14 19:33:20 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA26140 for hackers-outgoing; Fri, 14 Nov 1997 19:33:20 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from mailhost.Ipsilon.COM (mailhost.ipsilon.com [205.226.5.12]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id TAA26134 for ; Fri, 14 Nov 1997 19:33:18 -0800 (PST) (envelope-from jre@ipsilon.com) Received: from radio.ipsilon.com (radio.Ipsilon.COM [205.226.28.3]) by mailhost.Ipsilon.COM (8.6.11/8.6.10) with SMTP id TAA05410; Fri, 14 Nov 1997 19:32:15 -0800 Message-ID: <346D17BA.1B37ADEA@ipsilon.com> Date: Fri, 14 Nov 1997 19:32:10 -0800 From: Joe Eykholt Organization: Ipsilon Software Engineering X-Mailer: Mozilla 3.01Gold (X11; I; FreeBSD 2.1.0-RELEASE i386) MIME-Version: 1.0 To: jlemon@americantv.com CC: freebsd-hackers@freebsd.org Subject: Re: FreeBSD Pentium Bug fix (proposed) References: <199711150115.RAA18627@hub.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Jonathan Lemon wrote: > 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) Cool fix! It should work and seems much nicer than the two-page IDT fix. One point, though. The segment length is at least one byte since the limit in the descriptor is the last valid offset in the segment, not the length. That means that the address might be referenced. The granularity should be 0 for bytes. I think a user can map address 0 (at least on one OS) containing a single-byte instruction that might be run in ring 0, so another, guaranteed-invalid address might be better, or you might leave the P bit off in that segment or (better) in the IDT entry 6 descriptor, causing a segment-not-present fault. (I haven't tried any of this). Joe