* grub-core/lib/i386/xen/relocator.S: Fix hypercall ABI violation.
GRUB relied on %ebx being preserved across hypercall which isn't true.
This commit is contained in:
parent
d16ff5897f
commit
2c384f1e6e
2 changed files with 28 additions and 18 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2013-12-17 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/lib/i386/xen/relocator.S: Fix hypercall ABI violation.
|
||||||
|
|
||||||
|
GRUB relied on %ebx being preserved across hypercall which isn't true.
|
||||||
|
|
||||||
2013-12-17 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-12-17 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/lib/x86_64/xen/relocator.S: Fix hypercall ABI violation.
|
* grub-core/lib/x86_64/xen/relocator.S: Fix hypercall ABI violation.
|
||||||
|
|
|
@ -38,35 +38,36 @@ VARIABLE(grub_relocator_xen_remapper_map)
|
||||||
VARIABLE(grub_relocator_xen_remapper_map_high)
|
VARIABLE(grub_relocator_xen_remapper_map_high)
|
||||||
.long 0
|
.long 0
|
||||||
|
|
||||||
|
movl %ebx, %ebp
|
||||||
|
|
||||||
movl $2, %esi
|
movl $2, %esi
|
||||||
movl $__HYPERVISOR_update_va_mapping, %eax
|
movl $__HYPERVISOR_update_va_mapping, %eax
|
||||||
int $0x82
|
int $0x82
|
||||||
|
|
||||||
|
movl %ebp, %ebx
|
||||||
addl $(LOCAL(cont) - LOCAL(base)), %ebx
|
addl $(LOCAL(cont) - LOCAL(base)), %ebx
|
||||||
|
|
||||||
jmp *%ebx
|
jmp *%ebx
|
||||||
|
|
||||||
LOCAL(cont):
|
LOCAL(cont):
|
||||||
|
xorl %eax, %eax
|
||||||
/* mov imm32, %ecx */
|
movl %eax, %ebp
|
||||||
.byte 0xb9
|
1:
|
||||||
VARIABLE(grub_relocator_xen_paging_size)
|
|
||||||
.long 0
|
|
||||||
|
|
||||||
/* mov imm32, %ebx */
|
|
||||||
.byte 0xbb
|
|
||||||
VARIABLE(grub_relocator_xen_paging_start)
|
|
||||||
.long 0
|
|
||||||
|
|
||||||
/* mov imm32, %eax */
|
/* mov imm32, %eax */
|
||||||
.byte 0xb8
|
.byte 0xb8
|
||||||
VARIABLE(grub_relocator_xen_mfn_list)
|
VARIABLE(grub_relocator_xen_mfn_list)
|
||||||
.long 0
|
.long 0
|
||||||
|
|
||||||
movl %eax, %edi
|
movl %eax, %edi
|
||||||
1:
|
movl %ebp, %eax
|
||||||
movl %ecx, %ebp
|
movl 0(%edi, %eax, 4), %ecx
|
||||||
movl 0(%edi), %ecx
|
|
||||||
|
/* mov imm32, %ebx */
|
||||||
|
.byte 0xbb
|
||||||
|
VARIABLE(grub_relocator_xen_paging_start)
|
||||||
|
.long 0
|
||||||
|
shll $12, %eax
|
||||||
|
addl %eax, %ebx
|
||||||
movl %ecx, %edx
|
movl %ecx, %edx
|
||||||
shll $12, %ecx
|
shll $12, %ecx
|
||||||
shrl $20, %edx
|
shrl $20, %edx
|
||||||
|
@ -75,11 +76,14 @@ VARIABLE(grub_relocator_xen_mfn_list)
|
||||||
movl $__HYPERVISOR_update_va_mapping, %eax
|
movl $__HYPERVISOR_update_va_mapping, %eax
|
||||||
int $0x82
|
int $0x82
|
||||||
|
|
||||||
movl %ebp, %ecx
|
incl %ebp
|
||||||
addl $4, %edi
|
/* mov imm32, %ecx */
|
||||||
addl $4096, %ebx
|
.byte 0xb9
|
||||||
|
VARIABLE(grub_relocator_xen_paging_size)
|
||||||
|
.long 0
|
||||||
|
cmpl %ebp, %ecx
|
||||||
|
|
||||||
loop 1b
|
ja 1b
|
||||||
|
|
||||||
/* mov imm32, %ebx */
|
/* mov imm32, %ebx */
|
||||||
.byte 0xbb
|
.byte 0xbb
|
||||||
|
|
Loading…
Reference in a new issue