Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1399693
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/2] Fix efi_call |
| Date | 2016-05-12 08:50 +0200 |
| Message-ID | <rxSBz-im-13@gated-at.bofh.it> (permalink) |
| References | <rxIsy-6D9-3@gated-at.bofh.it> <rxIsz-6D9-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* Alex Thorlton <athorlton@sgi.com> 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. I suppose the SGI/UV code is the only one using 7 arguments or more? Might make sense to point that out in the changelog. > > Signed-off-by: Alex Thorlton <athorlton@sgi.com> > Cc: Dimitri Sivanich <sivanich@sgi.com> > Cc: Russ Anderson <rja@sgi.com> > Cc: Mike Travis <travis@sgi.com> > Cc: Matt Fleming <matt@codeblueprint.co.uk> > Cc: Borislav Petkov <bp@suse.de> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: "H. Peter Anvin" <hpa@zytor.com> > 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) Just curious, how did you find this bug? It's a pretty obscure one, of the 'developer tears out hairs from frustruation' type ... Thanks, Ingo
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 0/2] Fix EFI runtime calls on SGI UV Alex Thorlton <athorlton@sgi.com> - 2016-05-11 22:00 +0200
[PATCH 2/2] Fix efi_call Alex Thorlton <athorlton@sgi.com> - 2016-05-11 22:00 +0200
Re: [PATCH 2/2] Fix efi_call Ingo Molnar <mingo@kernel.org> - 2016-05-12 08:50 +0200
Re: [PATCH 2/2] Fix efi_call Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-12 13:50 +0200
Re: [PATCH 2/2] Fix efi_call Alex Thorlton <athorlton@sgi.com> - 2016-05-16 18:30 +0200
Re: [PATCH 2/2] Fix efi_call Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-12 13:50 +0200
Re: [PATCH 2/2] Fix efi_call Alex Thorlton <athorlton@sgi.com> - 2016-05-16 18:30 +0200
csiph-web