Commit 0d054ad9 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Ingo Molnar
Browse files

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: default avatarArd Biesheuvel <>
Signed-off-by: default avatarMatt Fleming <>
Cc: Borislav Petkov <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>

Signed-off-by: default avatarIngo Molnar <>
parent 884f4f66
......@@ -211,6 +211,10 @@ int __init efi_memblock_x86_reserve_range(void)
efi.memmap.desc_size = e->efi_memdesc_size;
efi.memmap.desc_version = e->efi_memdesc_version;
WARN(efi.memmap.desc_version != 1,
"Unexpected EFI_MEMORY_DESCRIPTOR version %ld",
memblock_reserve(pmap, efi.memmap.nr_map * efi.memmap.desc_size);
return 0;
......@@ -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",
if (uefi_init() < 0)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment