aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-04-25 16:06:40 -0400
committerIngo Molnar <mingo@kernel.org>2016-04-28 05:33:51 -0400
commit0d054ad96e97dcd8966e9333eabcc7a466672f70 (patch)
tree598653b7a67e4d616e5cf6a837e3cf226e5dac0c /arch/x86/platform
parent884f4f66ffd6ffe632f3a8be4e6d10a858afdc37 (diff)
efi: Check EFI_MEMORY_DESCRIPTOR version explicitly
Our efi_memory_desc_t type is based on EFI_MEMORY_DESCRIPTOR version 1 in the UEFI spec. No version updates are expected, but since we are about to introduce support for new firmware tables that use the same descriptor type, it makes sense to at least warn if we encounter other versions. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> Cc: Borislav Petkov <bp@alien8.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-9-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/platform')
-rw-r--r--arch/x86/platform/efi/efi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 88d2fb2cb3ef..dde46cd78b8f 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -211,6 +211,10 @@ int __init efi_memblock_x86_reserve_range(void)
211 efi.memmap.desc_size = e->efi_memdesc_size; 211 efi.memmap.desc_size = e->efi_memdesc_size;
212 efi.memmap.desc_version = e->efi_memdesc_version; 212 efi.memmap.desc_version = e->efi_memdesc_version;
213 213
214 WARN(efi.memmap.desc_version != 1,
215 "Unexpected EFI_MEMORY_DESCRIPTOR version %ld",
216 efi.memmap.desc_version);
217
214 memblock_reserve(pmap, efi.memmap.nr_map * efi.memmap.desc_size); 218 memblock_reserve(pmap, efi.memmap.nr_map * efi.memmap.desc_size);
215 219
216 return 0; 220 return 0;