Repository navigation
fix(x86): expose flat low RAM and skip EBDA ACPI on firmware boot - #581
Merged
Merged
Conversation
In x86 Board::create_ram() and Board::create_firmware_data(), the direct-boot low-memory layout (reserving [0x0, 0x500) for IVT/BDA and placing ACPI tables in [0x80000, 0xA0000)) was gated on spec.coco.is_none(). When booting non-CoCo UEFI firmware (such as OVMF/AVMF), those entries were exported via fw_cfg etc/e820 and ACPI tables were written into EBDA RAM even though firmware loads ACPI from fw_cfg and owns the low memory map. This broke upstream EDK2 in two ways: - OvmfPkg PlatformGetLowMemoryCB requires the low E820_RAM region to start at address 0 (EDK2 commit 0a0919607ceb). Starting etc/e820 with a Reserved entry left LowMemory at 0, falling back to CMOS (16 MiB) and underflowing PeiInstallPeiMemory. - DXE GetMemoryMap() asserts that Reserved GCD entries are 4 KiB page-aligned, rejecting the 0x500-byte entry. Replace the spec.coco.is_none() checks with !self.is_firmware_boot(), which checks whether the payload has a firmware image (CoCo guests always boot via firmware), so firmware boots expose a single [0, low_mem_size) RAM region in etc/e820. Signed-off-by: Changyuan Lyu <changyuanl@google.com>
Coverage Report for CI Build 47403048042Coverage decreased (-0.02%) to 48.214%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In x86 Board::create_ram() and Board::create_firmware_data(), the direct-boot low-memory layout (reserving [0x0, 0x500) for IVT/BDA and placing ACPI tables in [0x80000, 0xA0000)) was gated on spec.coco.is_none(). When booting non-CoCo UEFI firmware (such as OVMF/AVMF), those entries were exported via fw_cfg etc/e820 and ACPI tables were written into EBDA RAM even though firmware loads ACPI from fw_cfg and owns the low memory map.
This broke upstream EDK2 in two ways:
Replace the spec.coco.is_none() checks with !self.is_firmware_boot(), which checks whether the payload has a firmware image (CoCo guests always boot via firmware), so firmware boots expose a single [0, low_mem_size) RAM region in etc/e820.