summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorArd Biesheuvel2016-04-25 22:06:40 +0200
committerIngo Molnar2016-04-28 11:33:51 +0200
commit0d054ad96e97dcd8966e9333eabcc7a466672f70 (patch)
tree598653b7a67e4d616e5cf6a837e3cf226e5dac0c /drivers/firmware
parentefi: Remove global 'memmap' EFI memory map (diff)
downloadkernel-qcow2-linux-0d054ad96e97dcd8966e9333eabcc7a466672f70.tar.gz
kernel-qcow2-linux-0d054ad96e97dcd8966e9333eabcc7a466672f70.tar.xz
kernel-qcow2-linux-0d054ad96e97dcd8966e9333eabcc7a466672f70.zip
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 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/arm-init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index 90a9b473e45c..a84dddb54c14 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -198,6 +198,10 @@ void __init efi_init(void)
efi.memmap.desc_size = params.desc_size;
efi.memmap.desc_version = params.desc_ver;
+ WARN(efi.memmap.desc_version != 1,
+ "Unexpected EFI_MEMORY_DESCRIPTOR version %ld",
+ efi.memmap.desc_version);
+
if (uefi_init() < 0)
return;