|
@@ -101,6 +101,14 @@ static efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg,
|
|
|
if (status != EFI_SUCCESS)
|
|
|
goto fail;
|
|
|
|
|
|
+ /*
|
|
|
+ * Enforce minimum alignment that EFI requires when requesting
|
|
|
+ * a specific address. We are doing page-based allocations,
|
|
|
+ * so we must be aligned to a page.
|
|
|
+ */
|
|
|
+ if (align < EFI_PAGE_SIZE)
|
|
|
+ align = EFI_PAGE_SIZE;
|
|
|
+
|
|
|
nr_pages = round_up(size, EFI_PAGE_SIZE) / EFI_PAGE_SIZE;
|
|
|
again:
|
|
|
for (i = 0; i < map_size / desc_size; i++) {
|
|
@@ -179,6 +187,14 @@ static efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg,
|
|
|
if (status != EFI_SUCCESS)
|
|
|
goto fail;
|
|
|
|
|
|
+ /*
|
|
|
+ * Enforce minimum alignment that EFI requires when requesting
|
|
|
+ * a specific address. We are doing page-based allocations,
|
|
|
+ * so we must be aligned to a page.
|
|
|
+ */
|
|
|
+ if (align < EFI_PAGE_SIZE)
|
|
|
+ align = EFI_PAGE_SIZE;
|
|
|
+
|
|
|
nr_pages = round_up(size, EFI_PAGE_SIZE) / EFI_PAGE_SIZE;
|
|
|
for (i = 0; i < map_size / desc_size; i++) {
|
|
|
efi_memory_desc_t *desc;
|