[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1462996545-98387-3-git-send-email-athorlton@sgi.com>
Date: Wed, 11 May 2016 14:55:45 -0500
From: Alex Thorlton <athorlton@....com>
To: linux-kernel@...r.kernel.org
Cc: Alex Thorlton <athorlton@....com>,
Dimitri Sivanich <sivanich@....com>,
Russ Anderson <rja@....com>, Mike Travis <travis@....com>,
Matt Fleming <matt@...eblueprint.co.uk>,
Borislav Petkov <bp@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-efi@...r.kernel.org
Subject: [PATCH 2/2] Fix efi_call
The efi_call assembly code has a slight error that prevents us from
using arguments 7 and higher, which will be passed in on the stack.
mov (%rsp), %rax
mov 8(%rax), %rax
...
mov %rax, 40(%rsp)
This code goes and grabs the return address for the current stack frame,
and puts it on the stack, next the 5th argument for the EFI runtime
call. Considering the fact that having the return address in that
position on the stack makes no sense, I'm guessing that the intent of
this code was actually to grab an argument off the stack frame for this
call and place it into the frame for the next one.
The small change to that offset (i.e. 8(%rax) to 16(%rax)) ensures that
we grab the 7th argument off the stack, and pass it as the 6th argument
to the EFI runtime function that we're about to call. This change gets
our EFI runtime calls that need to pass more than 6 arguments working
again.
Signed-off-by: Alex Thorlton <athorlton@....com>
Cc: Dimitri Sivanich <sivanich@....com>
Cc: Russ Anderson <rja@....com>
Cc: Mike Travis <travis@....com>
Cc: Matt Fleming <matt@...eblueprint.co.uk>
Cc: Borislav Petkov <bp@...e.de>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
Cc: linux-efi@...r.kernel.org
---
arch/x86/platform/efi/efi_stub_64.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S
index 92723ae..62938ff 100644
--- a/arch/x86/platform/efi/efi_stub_64.S
+++ b/arch/x86/platform/efi/efi_stub_64.S
@@ -43,7 +43,7 @@ ENTRY(efi_call)
FRAME_BEGIN
SAVE_XMM
mov (%rsp), %rax
- mov 8(%rax), %rax
+ mov 16(%rax), %rax
subq $48, %rsp
mov %r9, 32(%rsp)
mov %rax, 40(%rsp)
--
1.8.5.6
Powered by blists - more mailing lists