Commit 67a9b9c5 authored by Daniel Kiper's avatar Daniel Kiper Committed by Matt Fleming

arch/x86: Do not access EFI memory map if it is not available

Do not access EFI memory map if it is not available. At least
Xen dom0 EFI implementation does not have an access to it.
Signed-off-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
parent abc93f8e
...@@ -946,6 +946,9 @@ u64 efi_mem_attributes(unsigned long phys_addr) ...@@ -946,6 +946,9 @@ u64 efi_mem_attributes(unsigned long phys_addr)
efi_memory_desc_t *md; efi_memory_desc_t *md;
void *p; void *p;
if (!efi_enabled(EFI_MEMMAP))
return 0;
for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
md = p; md = p;
if ((md->phys_addr <= phys_addr) && if ((md->phys_addr <= phys_addr) &&
......
Markdown is supported
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