Skip to content

Refactor Memory.rs#558

Merged
midnightveil merged 3 commits into
seL4:mainfrom
au-ts:callumb_and_cheng/iommu_memory_refactor
Jul 15, 2026
Merged

Refactor Memory.rs#558
midnightveil merged 3 commits into
seL4:mainfrom
au-ts:callumb_and_cheng/iommu_memory_refactor

Conversation

@cazb2

@cazb2 cazb2 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This PR makes a small change to the SDF work previously completed.

It then refactors the memory.rs module in preparation for adding support for IO Address Spaces. The refactor primarily introduces an address space abstraction that can allow simpler handling of different address space variants.

It also removes the pre-existing duplicated constants that are already defined by seL4. This commit extracts those and includes them in the Config struct that the tool passes around.

This PR preserves the existing behaviour.

cazb2 added 3 commits July 15, 2026 14:51
Minor adjustments to the prior sdf work to do with how permissions are
handled.  Previously I implemented read and write functions as part of
the SysIOMapPerms enum, however the old SysMapPerms did not do this.
Given these types are meant to exhibit similar behaviour extracting this
common logic into the Map trait provides a streamlined interface to
check if a permission is set.

Signed-off-by: Callum <c.berry@student.unsw.edu.au>
This commit is meant to preserve original functionality.

The memory.rs file previously was a collection of functions that allowed
the mapping of pages into vspaces. This commit refactors this logic into
an AddressSpace type. This will allow us to simply support new variants
of address spaces, including IO Address Spaces for devices. The majority
of changes are made to allow the old functions to be reusued in a more
generic way.

The changes to the builder.rs reflect the changes to memory.rs or make
use of the trait Map as trait bounds to handle both normal Mappings and
IOMappings.

Signed-off-by: Callum <c.berry@student.unsw.edu.au>
This commit integrates the improved config to the memory module.

This commit removes some of the duplicated constants definitions that
seL4 already exports.

Signed-off-by: Callum <c.berry@student.unsw.edu.au>

@midnightveil midnightveil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Was reviewed in au-ts#7 for easiness.

@midnightveil
midnightveil merged commit 770bf45 into seL4:main Jul 15, 2026
12 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.

2 participants