aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/libstub/efistub.h
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-05-04 11:02:48 -0400
committerArd Biesheuvel <ardb@kernel.org>2020-05-05 09:25:39 +0200
commitde8c55208c3865d0532466097b0244fbea1d9089 (patch)
tree9a2e21e93196b0146aa4b2f4d974251bab2c808f /drivers/firmware/efi/libstub/efistub.h
parentefi/libstub: Check return value of efi_parse_options (diff)
downloadlinux-dev-de8c55208c3865d0532466097b0244fbea1d9089.tar.xz
linux-dev-de8c55208c3865d0532466097b0244fbea1d9089.zip
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>
Diffstat (limited to 'drivers/firmware/efi/libstub/efistub.h')
-rw-r--r--drivers/firmware/efi/libstub/efistub.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index 874233cf8820..4f10a09563f3 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -33,20 +33,14 @@ extern bool efi_novamap;
extern const efi_system_table_t *efi_system_table;
-#ifndef efi_bs_call
+#ifndef ARCH_HAS_EFISTUB_WRAPPERS
+
+#define efi_is_native() (true)
#define efi_bs_call(func, ...) efi_system_table->boottime->func(__VA_ARGS__)
-#endif
-#ifndef efi_rt_call
#define efi_rt_call(func, ...) efi_system_table->runtime->func(__VA_ARGS__)
-#endif
-#ifndef efi_is_native
-#define efi_is_native() (true)
-#endif
-#ifndef efi_table_attr
#define efi_table_attr(inst, attr) (inst->attr)
-#endif
-#ifndef efi_call_proto
#define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__)
+
#endif
#define efi_info(msg) do { \