Skip to contentSkip to conversation

efi/x86: preserve %ebx correctly in efi_set_virtual_address_map()

PATCH Guenter Roeck 1 participant 1 message Mar 4, 2020 EFI

lore
Share & tools
lore

Guenter Roeck

author Tested-by
#0 lore raw
Quoted 10 lines · 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.

(on top of next-20200304)

Thanks for the quick fix!

Guenter

Quoted 20 lines
---
 arch/x86/platform/efi/efi_stub_32.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/platform/efi/efi_stub_32.S +1 -1
index 09237236fb25..09ec84f6ef51 100644
@@ -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)
Signature · 1 line
2.17.1