efi/libstub: Fix mixed mode boot issue after macro refactor
authorArvind Sankar <nivedita@alum.mit.edu>
Mon, 4 May 2020 15:02:48 +0000 (11:02 -0400)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 5 May 2020 07:25:39 +0000 (09:25 +0200)
commitde8c55208c3865d0532466097b0244fbea1d9089
tree9a2e21e93196b0146aa4b2f4d974251bab2c808f
parent055042bedd4e0af8186266b189b81e73e708b82b
efi/libstub: Fix mixed mode boot issue after macro refactor

Commit

  22090f84bc3f ("efi/libstub: unify EFI call wrappers for non-x86")

refactored the macros that are used to provide wrappers for mixed-mode
calls on x86, allowing us to boot a 64-bit kernel on 32-bit firmware.

Unfortunately, this broke mixed mode boot due to the fact that
efi_is_native() is not a macro on x86.

All of these macros should go together, so rather than testing each one
to see if it is defined, condition the generic macro definitions on a
new ARCH_HAS_EFISTUB_WRAPPERS, and remove the wrapper definitions on x86
as well if CONFIG_EFI_MIXED is not enabled.

Fixes: 22090f84bc3f ("efi/libstub: unify EFI call wrappers for non-x86")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Link: https://lore.kernel.org/r/20200504150248.62482-1-nivedita@alum.mit.edu
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/include/asm/efi.h
drivers/firmware/efi/libstub/efistub.h