Skip to content

fix(pal/uefi_acpi): update MemoryMapSize after memory map allocation#396

Merged
chetan-rathore merged 1 commit into
ARM-software:mainfrom
rajatgoyal47:main
May 8, 2026
Merged

fix(pal/uefi_acpi): update MemoryMapSize after memory map allocation#396
chetan-rathore merged 1 commit into
ARM-software:mainfrom
rajatgoyal47:main

Conversation

@rajatgoyal47
Copy link
Copy Markdown
Collaborator

Recompute MemoryMapSize from the allocated page count before retrying
GetMemoryMap. This keeps the buffer size passed to GetMemoryMap aligned
with the actual allocation size after AllocatePages succeeds.

Previously, the retry path allocated memory based on the required page
count but continued using the earlier MemoryMapSize value. Updating it
with EFI_PAGES_TO_SIZE(Pages) ensures the firmware receives the correct
buffer size for the allocated memory map buffer.

Fixes #357

Change-Id: I9ceaac06f73aee6797c225ea540d502095390d99

  Recompute MemoryMapSize from the allocated page count before retrying
  GetMemoryMap. This keeps the buffer size passed to GetMemoryMap aligned
  with the actual allocation size after AllocatePages succeeds.

  Previously, the retry path allocated memory based on the required page
  count but continued using the earlier MemoryMapSize value. Updating it
  with EFI_PAGES_TO_SIZE(Pages) ensures the firmware receives the correct
  buffer size for the allocated memory map buffer.

Signed-off-by: Rajat Goyal <rajat.goyal@arm.com>
Change-Id: I9ceaac06f73aee6797c225ea540d502095390d99
@chetan-rathore chetan-rathore merged commit 4ae3099 into ARM-software:main May 8, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetMemoryMapSize wrong in pal_memory_create_info_table ?

2 participants