[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] AMD HVM: Fix enter-realmode stub to initialise 32-bit GPRs.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1173870553 0
# Node ID f233456b89d59e63498e6e2e5736d61d5683d0b3
# Parent  2955b067731093888e7f97e3da93b51dc8b5d255
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@xxxxxxxxxxxxx>
---
 tools/firmware/hvmloader/hvmloader.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff -r 2955b0677310 -r f233456b89d5 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Wed Mar 14 10:44:56 2007 +0000
+++ b/tools/firmware/hvmloader/hvmloader.c      Wed Mar 14 11:09:13 2007 +0000
@@ -62,15 +62,21 @@ asm(
     "    mov  %ax,%fs                \n"
     "    mov  %ax,%gs                \n"
     "    mov  %ax,%ss                \n"
+    /* Initialise all 32-bit GPRs to zero. */
+    "    xor  %eax,%eax              \n"
+    "    xor  %ebx,%ebx              \n"
+    "    xor  %ecx,%ecx              \n"
+    "    xor  %edx,%edx              \n"
+    "    xor  %esp,%esp              \n"
+    "    xor  %ebp,%ebp              \n"
+    "    xor  %esi,%esi              \n"
+    "    xor  %edi,%edi              \n"
+    /* Enter real mode, reload all segment registers and IDT. */
     "    ljmp $0x8,$0x0              \n"
-    /* Enter real mode, reload all segment registers and IDT. */
     "trampoline_start: .code16       \n"
-    "    mov  %cr0,%eax              \n"
-    "    and  $0xfe,%al              \n"
     "    mov  %eax,%cr0              \n"
     "    ljmp $0,$1f-trampoline_start\n"
-    "1:  xor  %ax,%ax                \n"
-    "    mov  %ax,%ds                \n"
+    "1:  mov  %ax,%ds                \n"
     "    mov  %ax,%es                \n"
     "    mov  %ax,%fs                \n"
     "    mov  %ax,%gs                \n"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.