Re: New pentium bug workaround - please test..

Richard B. Johnson (root@chaos.analogic.com)
Tue, 18 Nov 1997 22:50:23 -0500 (EST)


On Tue, 18 Nov 1997, Linus Torvalds wrote:
[SNIPPED]
>
> Now, that implies that we can actually _keep_ the IDT mapped, and instead
> of marking it not present we can mark it read-only. Which is not a problem
> for normal faults, because normal faults will only read from the IDT
> anyway (including other illegal instruction faults).
>
> It's only the specific bug-fault that will try to do a write access to
> the IDT, and thus it is _only_ when the bug is triggered that we'll get
> the page protection fault. This also implies that we can do the check for
> the bug in the non-critical part of the page fault handler (ie in the case
> where we have already determined that it wasn't a good page fault), and
> that we don't need to play any games with updating eip etc - we can just
> call the illegal instruction handler directly.
>
> In short, the bug suddenly becomes pretty much a non-issue as far as
> Linux is concerned.

Damn good! If anybody tries to write to the IDT, seg-fault them. End of
story! That's a very good find. This means the Pentium was broken in
many ways because the exchange was not supposed to be with the descriptor
for the fault handler, but with something in user's memory addressed by a
register.

Cheers,
Dick Johnson

Richard B. Johnson
Project Engineer
Analogic Corporation
Penguin : Linux version 2.1.63 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.