Skip to contentSkip to conversation

efi/libstub/x86: fix mixed mode boot issue after macro refactor

PATCH Guenter Roeck 1 participant 1 message May 3, 2020 EFI

lore
Share & tools
lore

Guenter Roeck

author Tested-by
#0 lore raw
Quoted 10 lines · Ard Biesheuvel

Commit

22090f84bc3f8081 ("efi/libstub: Unify EFI call wrappers for non-x86")

refactored some macros that are used to wrap EFI service calls, and allow us to boot the 64-bit x86 kernel from 32-bit firmware. Sadly, due to an oversight, this caused a boot issue on mixed mode, due to the fact that efi_is_native() is not a macro on x86, and so #ifndef will not detect that it is already defined.

Quoted 4 lines

Fix this by defining the macro as well.

Quoted 19 lines
---
 arch/x86/include/asm/efi.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/include/asm/efi.h +1 -0
index cd0c3fbf6156..42b2fd123a2f 100644
@@ -240,6 +240,7 @@ static inline bool efi_is_native(void)
 		return true;
 	return efi_is_64bit();
 }
+#define efi_is_native efi_is_native
 
 #define efi_mixed_mode_cast(attr)					\
 	__builtin_choose_expr(						\
Signature · 1 line
2.26.2