* grub-core/kern/x86_64/efi/callwrap.S: Fix stack alignment.

Previously we misaligned stack by 8 in startup.S and compensated
	for it in callwrap.S. According to ABI docs (EFI and sysv amd64)
	right behaviour is to align stack in startup.S and keep it aligned
	in callwrap.S. startup.S part was committed few commits before. This
	takes care of callwrap.S.
	Reported by: Gary Lin.
This commit is contained in:
Vladimir Serbinenko 2013-11-22 05:40:32 +01:00
parent 054efe541f
commit 4e42521d8c
2 changed files with 36 additions and 26 deletions

View file

@ -1,3 +1,13 @@
2013-11-22 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/x86_64/efi/callwrap.S: Fix stack alignment.
Previously we misaligned stack by 8 in startup.S and compensated
for it in callwrap.S. According to ABI docs (EFI and sysv amd64)
right behaviour is to align stack in startup.S and keep it aligned
in callwrap.S. startup.S part was committed few commits before. This
takes care of callwrap.S.
Reported by: Gary Lin.
2013-11-22 Vladimir Serbinenko <phcoder@gmail.com> 2013-11-22 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/boot/mips/startup_raw.S: Handle the case of gap between * grub-core/boot/mips/startup_raw.S: Handle the case of gap between

View file

@ -36,94 +36,94 @@
.text .text
FUNCTION(efi_wrap_0) FUNCTION(efi_wrap_0)
subq $48, %rsp subq $40, %rsp
call *%rdi call *%rdi
addq $48, %rsp addq $40, %rsp
ret ret
FUNCTION(efi_wrap_1) FUNCTION(efi_wrap_1)
subq $48, %rsp subq $40, %rsp
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $48, %rsp addq $40, %rsp
ret ret
FUNCTION(efi_wrap_2) FUNCTION(efi_wrap_2)
subq $48, %rsp subq $40, %rsp
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $48, %rsp addq $40, %rsp
ret ret
FUNCTION(efi_wrap_3) FUNCTION(efi_wrap_3)
subq $48, %rsp subq $40, %rsp
mov %rcx, %r8 mov %rcx, %r8
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $48, %rsp addq $40, %rsp
ret ret
FUNCTION(efi_wrap_4) FUNCTION(efi_wrap_4)
subq $48, %rsp subq $40, %rsp
mov %r8, %r9 mov %r8, %r9
mov %rcx, %r8 mov %rcx, %r8
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $48, %rsp addq $40, %rsp
ret ret
FUNCTION(efi_wrap_5) FUNCTION(efi_wrap_5)
subq $48, %rsp subq $40, %rsp
mov %r9, 32(%rsp) mov %r9, 32(%rsp)
mov %r8, %r9 mov %r8, %r9
mov %rcx, %r8 mov %rcx, %r8
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $48, %rsp addq $40, %rsp
ret ret
FUNCTION(efi_wrap_6) FUNCTION(efi_wrap_6)
subq $64, %rsp subq $56, %rsp
mov 64+8(%rsp), %rax mov 56+8(%rsp), %rax
mov %rax, 40(%rsp) mov %rax, 40(%rsp)
mov %r9, 32(%rsp) mov %r9, 32(%rsp)
mov %r8, %r9 mov %r8, %r9
mov %rcx, %r8 mov %rcx, %r8
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $64, %rsp addq $56, %rsp
ret ret
FUNCTION(efi_wrap_7) FUNCTION(efi_wrap_7)
subq $96, %rsp subq $88, %rsp
mov 96+16(%rsp), %rax mov 88+16(%rsp), %rax
mov %rax, 48(%rsp) mov %rax, 48(%rsp)
mov 96+8(%rsp), %rax mov 88+8(%rsp), %rax
mov %rax, 40(%rsp) mov %rax, 40(%rsp)
mov %r9, 32(%rsp) mov %r9, 32(%rsp)
mov %r8, %r9 mov %r8, %r9
mov %rcx, %r8 mov %rcx, %r8
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $96, %rsp addq $88, %rsp
ret ret
FUNCTION(efi_wrap_10) FUNCTION(efi_wrap_10)
subq $96, %rsp subq $88, %rsp
mov 96+40(%rsp), %rax mov 88+40(%rsp), %rax
mov %rax, 72(%rsp) mov %rax, 72(%rsp)
mov 96+32(%rsp), %rax mov 88+32(%rsp), %rax
mov %rax, 64(%rsp) mov %rax, 64(%rsp)
mov 96+24(%rsp), %rax mov 88+24(%rsp), %rax
mov %rax, 56(%rsp) mov %rax, 56(%rsp)
mov 96+16(%rsp), %rax mov 88+16(%rsp), %rax
mov %rax, 48(%rsp) mov %rax, 48(%rsp)
mov 96+8(%rsp), %rax mov 88+8(%rsp), %rax
mov %rax, 40(%rsp) mov %rax, 40(%rsp)
mov %r9, 32(%rsp) mov %r9, 32(%rsp)
mov %r8, %r9 mov %r8, %r9
mov %rcx, %r8 mov %rcx, %r8
mov %rsi, %rcx mov %rsi, %rcx
call *%rdi call *%rdi
addq $96, %rsp addq $88, %rsp
ret ret