From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138AbcELLly (ORCPT ); Thu, 12 May 2016 07:41:54 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36961 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751336AbcELLlw (ORCPT ); Thu, 12 May 2016 07:41:52 -0400 Date: Thu, 12 May 2016 12:41:49 +0100 From: Matt Fleming To: Alex Thorlton Cc: linux-kernel@vger.kernel.org, Dimitri Sivanich , Russ Anderson , Mike Travis , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-efi@vger.kernel.org Subject: Re: [PATCH 2/2] Fix efi_call Message-ID: <20160512114149.GD2728@codeblueprint.co.uk> References: <1462996545-98387-1-git-send-email-athorlton@sgi.com> <1462996545-98387-3-git-send-email-athorlton@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462996545-98387-3-git-send-email-athorlton@sgi.com> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 May, at 02:55:45PM, Alex Thorlton wrote: > 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 > Cc: Dimitri Sivanich > Cc: Russ Anderson > Cc: Mike Travis > Cc: Matt Fleming > Cc: Borislav Petkov > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: x86@kernel.org > Cc: linux-efi@vger.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) Nice. Your fix looks good, so I've put it in the urgent queue and tagged it for stable.