efi/x86: Check number of arguments to variadic functions

On x86 we need to thunk through assembler stubs to call the EFI services
for mixed mode, and for runtime services in 64-bit mode. The assembler
stubs have limits on how many arguments it handles. Introduce a few
macros to check that we do not try to pass too many arguments to the
stubs.

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-16-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Arvind Sankar
2020-01-03 12:39:48 +01:00
committed by Ingo Molnar
szülő 4684abe375
commit 14b864f4b5
4 fájl változott, egészen pontosan 58 új sor hozzáadva és 8 régi sor törölve

Fájl megtekintése

@@ -10,7 +10,7 @@
#include <linux/linkage.h>
#include <asm/nospec-branch.h>
SYM_FUNC_START(efi_call)
SYM_FUNC_START(__efi_call)
pushq %rbp
movq %rsp, %rbp
and $~0xf, %rsp
@@ -24,4 +24,4 @@ SYM_FUNC_START(efi_call)
CALL_NOSPEC %rdi
leave
ret
SYM_FUNC_END(efi_call)
SYM_FUNC_END(__efi_call)

Fájl megtekintése

@@ -25,7 +25,7 @@
.text
.code64
SYM_CODE_START(efi64_thunk)
SYM_CODE_START(__efi64_thunk)
push %rbp
push %rbx
@@ -69,4 +69,4 @@ SYM_CODE_START(efi64_thunk)
2: pushl $__KERNEL_CS
pushl %ebp
lret
SYM_CODE_END(efi64_thunk)
SYM_CODE_END(__efi64_thunk)