diff options
author | Alexander Graf <agraf@suse.de> | 2018-01-24 14:54:21 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2018-01-28 21:37:13 +0100 |
commit | 6698bb343fec66a2167dcdfe5cd645e09166440e (patch) | |
tree | 21640312141097e0eb73074428193a27c811e8c6 | |
parent | 4f6c7b12ed425095e635c32f184e8f8002da3823 (diff) | |
download | u-boot-6698bb343fec66a2167dcdfe5cd645e09166440e.tar.gz |
efi: Conflict efi_loader with different stub bitness
We have 2 users of the EFI headers: efi_loader and the EFI stub. Efi_loader
always expects that the bitness of the definitions it uses is identical to
the execution.
The EFI stub however allows to run x86_64 U-Boot on 32bit EFI and the other
way around, so it allows for different bitness of EFI definitions and U-Boot
environment.
This patch explicitly requests via Kconfig that efi_loader can only be enabled
if the bitness is identical. Because we can run efi_loader on x86_64 without
EFI stub enabled, it also ensures that this case propagates the correct ABI
constraints.
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | include/efi.h | 2 | ||||
-rw-r--r-- | lib/efi_loader/Kconfig | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/efi.h b/include/efi.h index 2f0be9c86c..98bddbac1a 100644 --- a/include/efi.h +++ b/include/efi.h @@ -19,7 +19,7 @@ #include <linux/string.h> #include <linux/types.h> -#ifdef CONFIG_EFI_STUB_64BIT +#if CONFIG_EFI_STUB_64BIT || (!defined(CONFIG_EFI_STUB) && defined(__x86_64__)) /* EFI uses the Microsoft ABI which is not the default for GCC */ #define EFIAPI __attribute__((ms_abi)) #else diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index d2b6327119..827c267b60 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -1,6 +1,10 @@ config EFI_LOADER bool "Support running EFI Applications in U-Boot" depends on (ARM || X86) && OF_LIBFDT + # We need EFI_STUB_64BIT to be set on x86_64 with EFI_STUB + depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT + # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB + depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT default y help Select this option if you want to run EFI applications (like grub2) |