]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
x86/wakeup: Stop using %fs for lidt/lgdt
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 28 Apr 2019 14:13:37 +0000 (17:13 +0300)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 10 Jul 2019 23:03:34 +0000 (18:03 -0500)
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>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/boot/trampoline.S
xen/arch/x86/boot/wakeup.S

index 5588c7986aa6aa6f0241ecdb484a81e57953dd08..125bdb5a58a6fca59b7c00fd410270eb1068c2e6 100644 (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
index f9632eef952c8bb5e52c393e027c94fe583cba77..89df2617ae234a6ea8f606a2d88a50bf129589f4 100644 (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