mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
618d247ec8
commit
bc510c7fd5
1 file changed
+11
-5
@@ -62,15 +62,21 @@ asm(
|
||||
" mov %ax,%fs \n"
|
||||
" mov %ax,%gs \n"
|
||||
" mov %ax,%ss \n"
|
||||
" ljmp $0x8,$0x0 \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"
|
||||
"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"
|
||||
|
||||