Skip to content

Commit

Permalink
x86, boot: Move lldt/ltr out of 64bit code section
Browse files Browse the repository at this point in the history
commit 08da5a2

    x86_64: Early segment setup for VT

sets up LDT and TR into a valid state in order to speed up boot
decompression under VT.

Those code are put in code64, and it is using GDT that is only
loaded from code32 path.

That breaks booting with 64bit bootloader that does not go through
code32 path and jump to startup_64 directly, and it has different
GDT.

Move those lines into code32 after their GDT is loaded.

Signed-off-by: Yinghai Lu <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Cc: Zachary Amsden <[email protected]>
Cc: Matt Fleming <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Jan 29, 2013
1 parent 187a8a7 commit d3c433b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions arch/x86/boot/compressed/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ ENTRY(startup_32)
btsl $_EFER_LME, %eax
wrmsr

/* After gdt is loaded */
xorl %eax, %eax
lldt %ax
movl $0x20, %eax
ltr %ax

/*
* Setup for the jump to 64bit mode
*
Expand Down Expand Up @@ -239,9 +245,6 @@ preferred_addr:
movl %eax, %ss
movl %eax, %fs
movl %eax, %gs
lldt %ax
movl $0x20, %eax
ltr %ax

/*
* Compute the decompressed kernel start address. It is where
Expand Down

0 comments on commit d3c433b

Please sign in to comment.