aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/eboot.c
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-01-03 12:39:49 +0100
committerIngo Molnar <mingo@kernel.org>2020-01-10 18:55:04 +0100
commitea7d87f98fa9675076fb5ad208d889b217e83889 (patch)
tree77ee2f45103441c18fa5a7e1a60ccbda44936548 /arch/x86/boot/compressed/eboot.c
parentefi/x86: Check number of arguments to variadic functions (diff)
downloadlinux-dev-ea7d87f98fa9675076fb5ad208d889b217e83889.tar.xz
linux-dev-ea7d87f98fa9675076fb5ad208d889b217e83889.zip
efi/x86: Allow translating 64-bit arguments for mixed mode calls
Introduce the ability to define macros to perform argument translation for the calls that need it, and define them for the boot services that we currently use. When calling 32-bit firmware methods in mixed mode, all output parameters that are 32-bit according to the firmware, but 64-bit in the kernel (ie OUT UINTN * or OUT VOID **) must be initialized in the kernel, or the upper 32 bits may contain garbage. Define macros that zero out the upper 32 bits of the output before invoking the firmware method. When a 32-bit EFI call takes 64-bit arguments, the mixed-mode call must push the two 32-bit halves as separate arguments onto the stack. This can be achieved by splitting the argument into its two halves when calling the assembler thunk. Define a macro to do this for the free_pages boot service. Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Matthew Garrett <mjg59@google.com> Cc: linux-efi@vger.kernel.org Link: https://lkml.kernel.org/r/20200103113953.9571-17-ardb@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/boot/compressed/eboot.c')
-rw-r--r--arch/x86/boot/compressed/eboot.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 565ee4733579..4afd29eb5b34 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -891,19 +891,3 @@ fail:
for (;;)
asm("hlt");
}
-
-#ifdef CONFIG_EFI_MIXED
-void efi_free_native(unsigned long size, unsigned long addr);
-
-void efi_free(unsigned long size, unsigned long addr)
-{
- if (!size)
- return;
-
- if (efi_is_native())
- efi_free_native(size, addr);
- else
- efi64_thunk(efi_system_table()->boottime->mixed_mode.free_pages,
- addr, 0, DIV_ROUND_UP(size, EFI_PAGE_SIZE));
-}
-#endif