]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
x86/boot: Only jump into low trampoline code for real-mode boot
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 28 Apr 2019 15:38:37 +0000 (18:38 +0300)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 10 Jul 2019 23:03:34 +0000 (18:03 -0500)
If the no-real-mode flag is set, don't go there at all. This is a prelude
to not even putting it there in the first place.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
xen/arch/x86/boot/head.S
xen/arch/x86/boot/trampoline.S

index db19ac6fd80fccd6833985add410bcedc5657255..7c30de3671dfe0b690cffb1677d25219898e247b 100644 (file)
@@ -734,7 +734,17 @@ trampoline_setup:
         /* Switch to low-memory stack which lives at the end of trampoline region. */
         mov     sym_fs(trampoline_phys),%edi
         lea     TRAMPOLINE_SPACE+TRAMPOLINE_STACK_SPACE(%edi),%esp
+        cmpb    $0, sym_fs(skip_realmode)
+        jz      1f
+        /* If no-real-mode, jump straight to trampoline_protmode_entry */
+        lea     trampoline_protmode_entry-trampoline_start(%edi),%eax
+        /* EBX == 0 indicates we are the BP (Boot Processor). */
+        xor     %ebx,%ebx
+        jmp     2f
+1:
+        /* Go via 16-bit code in trampoline_boot_cpu_entry */
         lea     trampoline_boot_cpu_entry-trampoline_start(%edi),%eax
+2:
         pushl   $BOOT_CS32
         push    %eax
 
index 125bdb5a58a6fca59b7c00fd410270eb1068c2e6..97f85f942fccd9a0ad71f6cda370cc2a144fd585 100644 (file)
@@ -187,9 +187,6 @@ gdt_48: .word   6*8-1
 
         .code32
 trampoline_boot_cpu_entry:
-        cmpb    $0,bootsym_rel(skip_realmode,5)
-        jnz     .Lskip_realmode
-
         /* Load pseudo-real-mode segments. */
         mov     $BOOT_PSEUDORM_DS,%eax
         mov     %eax,%ds
@@ -269,7 +266,6 @@ trampoline_boot_cpu_entry:
         mov     %eax,%gs
         mov     %eax,%ss
 
-.Lskip_realmode:
         /* EBX == 0 indicates we are the BP (Boot Processor). */
         xor     %ebx,%ebx