Pull EFI updates from Ingo Molnar: "The main EFI changes in this cycle were: - Use 32-bit alignment for efi_guid_t - Allow the SetVirtualAddressMap() call to be omitted - Implement earlycon=efifb based on existing earlyprintk code - Various minor fixes and code cleanups from Sai, Ard and me" * 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: Fix build error due to enum collision between efi.h and ima.h efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation x86: Make ARCH_USE_MEMREMAP_PROT a generic Kconfig symbol efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted efi: Replace GPL license boilerplate with SPDX headers efi/fdt: Apply more cleanups efi: Use 32-bit alignment for efi_guid_t efi/memattr: Don't bail on zero VA if it equals the region's PA x86/efi: Mark can_free_region() as an __init function
Showing the changes to include/linux (1 of 46 files). Show all
Unified · Split
| @@ -48,7 +48,20 @@ typedef u16 efi_char16_t; /* UNICODE character */ · 47 unmodified lines | |||
| 48 | typedef u64 efi_physical_addr_t; | 48 | typedef u64 efi_physical_addr_t; |
| 49 | typedef void *efi_handle_t; | 49 | typedef void *efi_handle_t; |
| 50 | 50 | ||
| 51 | typedef guid_t efi_guid_t; | 51 | /* |
| 52 | * The UEFI spec and EDK2 reference implementation both define EFI_GUID as | ||
| 53 | * struct { u32 a; u16; b; u16 c; u8 d[8]; }; and so the implied alignment | ||
| 54 | * is 32 bits not 8 bits like our guid_t. In some cases (i.e., on 32-bit ARM), | ||
| 55 | * this means that firmware services invoked by the kernel may assume that | ||
| 56 | * efi_guid_t* arguments are 32-bit aligned, and use memory accessors that | ||
| 57 | * do not tolerate misalignment. So let's set the minimum alignment to 32 bits. | ||
| 58 | * | ||
| 59 | * Note that the UEFI spec as well as some comments in the EDK2 code base | ||
| 60 | * suggest that EFI_GUID should be 64-bit aligned, but this appears to be | ||
| 61 | * a mistake, given that no code seems to exist that actually enforces that | ||
| 62 | * or relies on it. | ||
| 63 | */ | ||
| 64 | typedef guid_t efi_guid_t __aligned(__alignof__(u32)); | ||
| 52 | 65 | ||
| 53 | #define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ | 66 | #define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ |
| 54 | GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) | 67 | GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) |
| @@ -1699,19 +1712,19 @@ extern int efi_tpm_eventlog_init(void); · 1644 unmodified lines | |||
| 1699 | * fault happened while executing an efi runtime service. | 1712 | * fault happened while executing an efi runtime service. |
| 1700 | */ | 1713 | */ |
| 1701 | enum efi_rts_ids { | 1714 | enum efi_rts_ids { |
| 1702 | NONE, | 1715 | EFI_NONE, |
| 1703 | GET_TIME, | 1716 | EFI_GET_TIME, |
| 1704 | SET_TIME, | 1717 | EFI_SET_TIME, |
| 1705 | GET_WAKEUP_TIME, | 1718 | EFI_GET_WAKEUP_TIME, |
| 1706 | SET_WAKEUP_TIME, | 1719 | EFI_SET_WAKEUP_TIME, |
| 1707 | GET_VARIABLE, | 1720 | EFI_GET_VARIABLE, |
| 1708 | GET_NEXT_VARIABLE, | 1721 | EFI_GET_NEXT_VARIABLE, |
| 1709 | SET_VARIABLE, | 1722 | EFI_SET_VARIABLE, |
| 1710 | QUERY_VARIABLE_INFO, | 1723 | EFI_QUERY_VARIABLE_INFO, |
| 1711 | GET_NEXT_HIGH_MONO_COUNT, | 1724 | EFI_GET_NEXT_HIGH_MONO_COUNT, |
| 1712 | RESET_SYSTEM, | 1725 | EFI_RESET_SYSTEM, |
| 1713 | UPDATE_CAPSULE, | 1726 | EFI_UPDATE_CAPSULE, |
| 1714 | QUERY_CAPSULE_CAPS, | 1727 | EFI_QUERY_CAPSULE_CAPS, |
| 1715 | }; | 1728 | }; |
| 1716 | 1729 | ||
| 1717 | /* | 1730 | /* |