• Arvind Sankar's avatar
    efi/x86: Allow translating 64-bit arguments for mixed mode calls · ea7d87f9
    Arvind Sankar authored
    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: default avatarArvind Sankar <nivedita@alum.mit.edu>
    Signed-off-by: default avatarArd 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.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    ea7d87f9
eboot.c 21.7 KB