linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH efi-next] efi/x86: preserve %ebx correctly in efi_set_virtual_address_map()
@ 2020-03-04 15:54 Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-03-04 15:54 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-efi

On Wed, Mar 04, 2020 at 02:35:15PM +0100, Ard Biesheuvel wrote:
> Commit 59f2a619a2db8611 ("efi: Add 'runtime' pointer to struct efi")
> modified the assembler routine called by efi_set_virtual_address_map(),
> to grab the 'runtime' EFI service pointer while running with paging
> disabled (which is tricky to do in C code)
> 
> After the change, register %ebx is not restored correctly, resulting
> in all kinds of weird behavior, so fix that.
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Tested-by: Guenter Roeck <linux@roeck-us.net>

(on top of next-20200304)

Thanks for the quick fix!

Guenter

> ---
>  arch/x86/platform/efi/efi_stub_32.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/platform/efi/efi_stub_32.S b/arch/x86/platform/efi/efi_stub_32.S
> index 09237236fb25..09ec84f6ef51 100644
> --- a/arch/x86/platform/efi/efi_stub_32.S
> +++ b/arch/x86/platform/efi/efi_stub_32.S
> @@ -54,7 +54,7 @@ SYM_FUNC_START(efi_call_svam)
>  	orl	$0x80000000, %edx
>  	movl	%edx, %cr0
>  
> -	pop	%ebx
> +	movl	16(%esp), %ebx
>  	leave
>  	ret
>  SYM_FUNC_END(efi_call_svam)
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH efi-next] efi/x86: preserve %ebx correctly in efi_set_virtual_address_map()
@ 2020-03-04 13:35 Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2020-03-04 13:35 UTC (permalink / raw)
  To: linux-efi; +Cc: linux, Ard Biesheuvel

Commit 59f2a619a2db8611 ("efi: Add 'runtime' pointer to struct efi")
modified the assembler routine called by efi_set_virtual_address_map(),
to grab the 'runtime' EFI service pointer while running with paging
disabled (which is tricky to do in C code)

After the change, register %ebx is not restored correctly, resulting
in all kinds of weird behavior, so fix that.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/x86/platform/efi/efi_stub_32.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/platform/efi/efi_stub_32.S b/arch/x86/platform/efi/efi_stub_32.S
index 09237236fb25..09ec84f6ef51 100644
--- a/arch/x86/platform/efi/efi_stub_32.S
+++ b/arch/x86/platform/efi/efi_stub_32.S
@@ -54,7 +54,7 @@ SYM_FUNC_START(efi_call_svam)
 	orl	$0x80000000, %edx
 	movl	%edx, %cr0
 
-	pop	%ebx
+	movl	16(%esp), %ebx
 	leave
 	ret
 SYM_FUNC_END(efi_call_svam)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-04 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 15:54 [PATCH efi-next] efi/x86: preserve %ebx correctly in efi_set_virtual_address_map() Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2020-03-04 13:35 Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).