acpi_spec: add IORT RMR (Reserved Memory Range) node types#3973
Merged
Conversation
Nested SMMU translation needs to tell the guest to identity-map certain IOVA windows (notably the host IOMMU's MSI region) in its stage-1 page tables. On ACPI systems that is expressed with an IORT RMR node. Add the RMR node header (IortRmr), its memory-range descriptor (IortRmrDescriptor), and the associated flags and revision constants, following IORT spec DEN0049E E.5, with const_assert_eq! size checks matching the other IORT node types. These are pure type definitions with no emitter yet; the ACPI builder consumes them in a later change.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Arm IORT (DEN0049E §E.5) Reserved Memory Range (RMR) node definitions to acpi_spec, including constants, on-wire packed structs, constructors, and compile-time size assertions. This extends the existing IORT type set so later PRs can emit RMR nodes into generated ACPI tables.
Changes:
- Added
IORT_NODE_TYPE_RMRand RMR-related revision/flag constants. - Introduced
IortRmrandIortRmrDescriptorpacked on-wire structs withzerocopyderives. - Added
const_assert_eq!checks for RMR struct sizes to match the spec layout.
Accumulate the RMR node's total length in usize and convert to the on-wire u16 length field via try_from, rather than casting each term to u16 and multiplying in u16 (which could silently wrap to a too-small length for large mapping/descriptor counts). Realistic counts are tiny, but this makes an oversized node fail loudly instead of emitting a malformed table.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
vm/acpi_spec/src/iort.rs:343
IortRmr's doc comment says the node is laid out asIortRmrDescriptor[]followed byIortIdMapping[], butnew()currently setsmapping_offsetto immediately follow the fixed header and setsrmr_offsetto follow the ID mappings. If callers append descriptors first (per the doc), the offsets will be wrong. Consider switching the offsets sormr_offsetpoints right after the fixed header andmapping_offsetpoints after the descriptor array (and adjust the total-size comment accordingly).
// Total node size: fixed header + ID mappings + RMR descriptors.
// Accumulate in `usize` and convert to the on-wire `u16` `length`
// field via `try_into`, so an oversized node fails loudly instead of
// silently wrapping to a too-small length.
let total = size_of::<Self>()
jstarks
marked this pull request as ready for review
July 20, 2026 08:35
chris-oo
approved these changes
Jul 20, 2026
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.
Adds the IORT Reserved Memory Range (RMR) node types (
IortRmr,IortRmrDescriptor) and associated constants from the IORT spec (DEN0049E §E.5), withconst_assert_eq!size checks matching the on-wire layout.RMR nodes let firmware describe IOVA ranges the guest must identity-map in its stage-1 page tables (e.g. the host IOMMU's MSI window), which the accelerated SMMU path needs so MSIs are delivered through nested translation. This PR only adds the spec types; the code that emits RMR nodes into the IORT lands in a later PR.