summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2018-06-18 17:23:00 +0200
committerAlexander Graf <agraf@suse.de>2018-07-25 14:57:43 +0200
commit62f375787084b1835967bc4d735bc245096b99fc (patch)
tree9314e4e7d38cd5e661dbd8368cd3a775d04ef41e /lib
parent354264b31d3c536ce0c4d3ac87acfd3fa7ac808a (diff)
downloadu-boot-62f375787084b1835967bc4d735bc245096b99fc.tar.gz
u-boot-62f375787084b1835967bc4d735bc245096b99fc.tar.xz
u-boot-62f375787084b1835967bc4d735bc245096b99fc.zip
efi_loader: Allow SMBIOS tables in highmem
We try hard to make sure that SMBIOS tables live in the lower 32bit. However, when we can not find any space at all there, we should not error out but instead just fall back to map them in the full address space instead. This can for example happen on systems that do not have any RAM mapped in the lower 32bits of address space. In that case having any SMBIOS tables at all is better than having none. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_smbios.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_smbios.c b/lib/efi_loader/efi_smbios.c
index 7c3fc8af0b..932f7582ec 100644
--- a/lib/efi_loader/efi_smbios.c
+++ b/lib/efi_loader/efi_smbios.c
@@ -26,8 +26,15 @@ efi_status_t efi_smbios_register(void)
/* Reserve 4kiB page for SMBIOS */
ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
EFI_RUNTIME_SERVICES_DATA, 1, &dmi);
- if (ret != EFI_SUCCESS)
- return ret;
+
+ if (ret != EFI_SUCCESS) {
+ /* Could not find space in lowmem, use highmem instead */
+ ret = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES,
+ EFI_RUNTIME_SERVICES_DATA, 1, &dmi);
+
+ if (ret != EFI_SUCCESS)
+ return ret;
+ }
/*
* Generate SMBIOS tables - we know that efi_allocate_pages() returns