OSDN Git Service

efi/x86: libstub: Make DXE calls mixed mode safe
authorArd Biesheuvel <ardb@kernel.org>
Fri, 20 May 2022 10:07:58 +0000 (12:07 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 1 Jun 2022 12:08:12 +0000 (14:08 +0200)
commit31f1a0edff78c43e8a3bd3692af0db1b25c21b17
tree7a77266725e0604c45e10b94855f4cf296a25d57
parentca209f8b5f61b74782dd4275ebc7173d92cb4905
efi/x86: libstub: Make DXE calls mixed mode safe

The newly added DXE calls use 64-bit quantities, which means we need to
marshall them explicitly when running in mixed mode. Currently, we get
away without it because we just bail when GetMemorySpaceDescriptor()
fails, which is guaranteed to happen due to the function argument mixup.

Let's fix this properly, though, by defining the macros that describe
how to marshall the arguments. While at it, drop an incorrect cast on a
status variable.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/include/asm/efi.h
drivers/firmware/efi/libstub/x86-stub.c