Setting cr0 requires a jmp to synchronize on 386/486
authorH. Peter Anvin <hpa@zytor.com>
Mon, 5 Nov 2007 00:34:38 +0000 (16:34 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 5 Nov 2007 00:34:38 +0000 (16:34 -0800)
The 386 and 486 requires a jmp after any setting of cr0.  It can be a
near jmp, but those processors do not correctly synchronize without
it.

We have jmps after setting cr0 in all spots except one, so make that
happen correctly.

bcopy32.inc

index 87190d8..4df5e43 100644 (file)
@@ -532,7 +532,8 @@ trampoline_to_pm:
                mov eax,cr0
                or al,1
                mov cr0,eax             ; Enter protected mode
-               mov ax,PM_DS32          ; 32-bit data segment selector
+               jmp .next               ; Near jump to synchronize on 386/486
+.next:         mov ax,PM_DS32          ; 32-bit data segment selector
                mov es,ax
                mov ds,ax
                mov ss,ax