x86/wakeup: Stop using %fs for lidt/lgdt

The wakeup code is now relocated alongside the trampoline code, so
as long as we move idt_48 and gdt_48 up a little bit so that they're
visible in the real-mode segment that the wakeup code runs in, using
%ds is just fine here.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
David Woodhouse authored and Andrew Cooper committed 2019-05-13 10:35:37 +01:00
1 parent 7c169a700a
commit c1740dc20a
2 files changed
+9 -16

No files matched your search

+7 -7
View File
@@ -52,13 +52,6 @@ GLOBAL(trampoline_realmode_entry)
lmsw %ax # CR0.PE = 1 (enter protected mode)
ljmpl $BOOT_CS32,$bootsym_rel(trampoline_protmode_entry,6)
.balign 8
.word 0
idt_48: .word 0, 0, 0 # base = limit = 0
.word 0
gdt_48: .word 6*8-1
.long bootsym_rel(trampoline_gdt,4)
trampoline_gdt:
/* 0x0000: unused */
.quad 0x0000000000000000
@@ -178,6 +171,13 @@ start64:
#include "wakeup.S"
.balign 8
.word 0
idt_48: .word 0, 0, 0 # base = limit = 0
.word 0
gdt_48: .word 6*8-1
.long bootsym_rel(trampoline_gdt,4)
/* The first page of trampoline is permanent, the rest boot-time only. */
/* Reuse the boot trampoline on the 1st trampoline page as stack for wakeup. */
.equ wakeup_stack, trampoline_start + PAGE_SIZE
+2 -9
View File
@@ -40,11 +40,8 @@ ENTRY(wakeup_start)
movw %ax, %fs
movw $0x0e00 + 'L', %fs:(0x10)
# boot trampoline is under 1M, and shift its start into
# %fs to reference symbols in that area
mov wakesym(trampoline_seg), %fs
lidt %fs:bootsym(idt_48)
lgdt %fs:bootsym(gdt_48)
lidt wakesym(idt_48)
lgdt wakesym(gdt_48)
movw $1, %ax
lmsw %ax # Turn on CR0.PE
@@ -102,10 +99,6 @@ GLOBAL(video_mode)
.long 0
GLOBAL(video_flags)
.long 0
trampoline_seg: .word 0
.pushsection .trampoline_seg, "a"
.long trampoline_seg - .
.popsection
.code32
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.