openvmm_core: start aarch64 Linux direct boot RAM at 1 GiB#3559
Open
jstarks wants to merge 1 commit into
Open
Conversation
On aarch64, iommufd reserves the 128 MiB–129 MiB region in IOVA space for the host MSI doorbell. When openvmm places guest RAM starting at address 0, identity-mapped DMA for passthrough devices fails because iommufd cannot allocate IOVAs that overlap this reservation. Avoid the conflict by starting RAM at 1 GiB for aarch64 Linux direct boot. This is implemented via a new ram_start_address field on MemoryLayoutInput that reserves the low GPA range so the memory layout allocator places RAM above it. UEFI boot is not yet handled because UEFI currently requires low memory to start; this is left as future work.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the aarch64 Linux direct-boot guest physical memory layout so guest RAM no longer starts at GPA 0, avoiding the low-address region that conflicts with iommufd’s reserved IOVA window used for the host MSI doorbell. It does this by introducing a configurable minimum RAM start address and reserving the low GPA range during layout allocation.
Changes:
- Add
ram_start_addresstoMemoryLayoutInputand reserve0..ram_start_addressduring layout allocation so RAM is placed above it. - In VM initialization, set
ram_start_addressto 1 GiB for aarch64 Linux direct boot; keep existing behavior for other architectures / load modes. - Update test helper construction to include the new field.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| openvmm/openvmm_core/src/worker/memory_layout.rs | Adds a ram_start_address input and reserves low GPA space so ordinary RAM is allocated above the requested minimum address. |
| openvmm/openvmm_core/src/worker/dispatch.rs | Sets ram_start_address = 1 GiB for aarch64 Linux direct boot to avoid the iommufd-reserved low IOVA region. |
| // used on aarch64 Linux direct boot to skip the 128 MiB–129 MiB IOVA | ||
| // region that iommufd reserves for the host MSI doorbell. | ||
| if input.ram_start_address > 0 { | ||
| builder.reserve("low-ram-gap", MemoryRange::new(0..input.ram_start_address)); |
Comment on lines
+146
to
+151
| // Reserve low addresses so RAM starts above `ram_start_address`. This is | ||
| // used on aarch64 Linux direct boot to skip the 128 MiB–129 MiB IOVA | ||
| // region that iommufd reserves for the host MSI doorbell. | ||
| if input.ram_start_address > 0 { | ||
| builder.reserve("low-ram-gap", MemoryRange::new(0..input.ram_start_address)); | ||
| } |
Comment on lines
+1012
to
+1013
| // FUTURE: this needs to be present for UEFI as well, but UEFI cannot | ||
| // only boot from low memory. Either: |
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.
On aarch64, iommufd reserves the 128 MiB–129 MiB region in IOVA space for the host MSI doorbell. When openvmm places guest RAM starting at address 0, identity-mapped DMA for passthrough devices fails because iommufd cannot allocate IOVAs that overlap this reservation.
Avoid the conflict by starting RAM at 1 GiB for aarch64 Linux direct boot. This is implemented via a new ram_start_address field on MemoryLayoutInput that reserves the low GPA range so the memory layout allocator places RAM above it.
UEFI boot is not yet handled because UEFI currently requires low memory to start; this is left as future work.