direct-io.hg

changeset 14367:f233456b89d5

AMD HVM: Fix enter-realmode stub to initialise 32-bit GPRs.

This fixes booting Ubuntu live ISO, which assumes the upper half of
%esp is zero on entry.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Mar 14 11:09:13 2007 +0000 (2007-03-14)
parents 2955b0677310
children 2787228610af
files tools/firmware/hvmloader/hvmloader.c
line diff
     1.1 --- a/tools/firmware/hvmloader/hvmloader.c	Wed Mar 14 10:44:56 2007 +0000
     1.2 +++ b/tools/firmware/hvmloader/hvmloader.c	Wed Mar 14 11:09:13 2007 +0000
     1.3 @@ -62,15 +62,21 @@ asm(
     1.4      "    mov  %ax,%fs                \n"
     1.5      "    mov  %ax,%gs                \n"
     1.6      "    mov  %ax,%ss                \n"
     1.7 -    "    ljmp $0x8,$0x0              \n"
     1.8 +    /* Initialise all 32-bit GPRs to zero. */
     1.9 +    "    xor  %eax,%eax              \n"
    1.10 +    "    xor  %ebx,%ebx              \n"
    1.11 +    "    xor  %ecx,%ecx              \n"
    1.12 +    "    xor  %edx,%edx              \n"
    1.13 +    "    xor  %esp,%esp              \n"
    1.14 +    "    xor  %ebp,%ebp              \n"
    1.15 +    "    xor  %esi,%esi              \n"
    1.16 +    "    xor  %edi,%edi              \n"
    1.17      /* Enter real mode, reload all segment registers and IDT. */
    1.18 +    "    ljmp $0x8,$0x0              \n"
    1.19      "trampoline_start: .code16       \n"
    1.20 -    "    mov  %cr0,%eax              \n"
    1.21 -    "    and  $0xfe,%al              \n"
    1.22      "    mov  %eax,%cr0              \n"
    1.23      "    ljmp $0,$1f-trampoline_start\n"
    1.24 -    "1:  xor  %ax,%ax                \n"
    1.25 -    "    mov  %ax,%ds                \n"
    1.26 +    "1:  mov  %ax,%ds                \n"
    1.27      "    mov  %ax,%es                \n"
    1.28      "    mov  %ax,%fs                \n"
    1.29      "    mov  %ax,%gs                \n"