Re: [PATCH] Re: BOOT_CS

Rene Herman
2004-02-23T15:24:44Z

Jamie Lokier wrote:

> Your patch uses two instructions to flush the queue (push+ret) instead
> of one (jmp or ljmp). Is that documented as reliable?

No. The current arch manuals seem to say nothing definite, but Intel's
386 manual (ie, the cpu, not the arch) from 1986 explicitly says "after
setting PG, a jump must follow immediately".

> I can easily imagine an implementation which decodes one instruction
> after a mode change predictably, but not two.
>
> I doubt that it makes a difference - we're setting PG, not changing
> the instruction format - but I'd like us to be sure it cannot fail on
> things like 386s and 486s, and similar non-Intel chips.

I believe you should either keep it as is, do the long jump (although I
don't believe that to be necessary: setup.s already long jumped to us)
or only delete the indirect jump (we've just been longjumped to, and
identity-mapped, so everything would seem to be normalised already).

In any case, please jump directly after setting PG.

Rene.