Skip to content

Commit

Permalink
x86 setup: add a near jump to serialize %cr0 on 386/486
Browse files Browse the repository at this point in the history
The 386 and 486 needs a jump immediately after setting %cr0 in order
to serialize the pipeline.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
H. Peter Anvin committed Nov 5, 2007
1 parent b55d1b1 commit 7ed1929
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/boot/pmjump.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ protected_mode_jump:
xorl %ebx, %ebx # Flag to indicate this is a boot
movl %edx, %esi # Pointer to boot_params table
movl %eax, 2f # Patch ljmpl instruction
jmp 1f # Short jump to flush instruction q.

1:
movw $__BOOT_DS, %cx

movl %cr0, %edx
orb $1, %dl # Protected mode (PE) bit
movl %edx, %cr0
jmp 1f # Short jump to serialize on 386/486
1:

movw %cx, %ds
movw %cx, %es
Expand Down

0 comments on commit 7ed1929

Please sign in to comment.