Re: [PATCH 2/6] x86, efi: Fix 32-bit EFI handover protocol entry point

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2013-01-10 at 18:04 +0000, David Woodhouse wrote:
> From: David Woodhouse <David.Woodhouse@xxxxxxxxx>
> 
> If the bootloader calls the EFI handover entry point as a standard function
> call, then it'll have a return address on the stack. We need to pop that
> before calling efi_main(), or the arguments will all be out of position on
> the stack.
> 
> Signed-off-by: David Woodhouse <David.Woodhouse@xxxxxxxxx>
> ---
>  arch/x86/boot/compressed/head_32.S | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
> index aa4aaf1..ccb2f4a 100644
> --- a/arch/x86/boot/compressed/head_32.S
> +++ b/arch/x86/boot/compressed/head_32.S
> @@ -50,8 +50,10 @@ ENTRY(startup_32)
>  	pushl	%eax
>  	pushl	%esi
>  	pushl	%ecx
> +	sub	$0x4, %esp
>  
>  	.org 0x30,0x90
> +	add	$0x4, %esp
>  	call	efi_main
>  	cmpl	$0, %eax
>  	movl	%eax, %esi

It's worth pointing out that efilinux doesn't invoke the handover
protocol as a function, it pushes arguments onto the stack and jumps. So
this change will actually break that boot loader.

Is there a particular reason why you need to invoke it as a standard
function on 32-bits?

-- 
Matt Fleming, Intel Open Source Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux