Skip to content

IOMMU: Continue Prior Work#544

Closed
cazb2 wants to merge 3 commits into
seL4:pr_base_sdf_iommu_supportfrom
au-ts:callumb_and_cheng/iommu_memory_refactor
Closed

IOMMU: Continue Prior Work#544
cazb2 wants to merge 3 commits into
seL4:pr_base_sdf_iommu_supportfrom
au-ts:callumb_and_cheng/iommu_memory_refactor

Conversation

@cazb2

@cazb2 cazb2 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This PR makes a small change to the SDF work previously done. It might be simpler to merge that work to make reviewing new changes simpler. (Only the latest two commits have new content)

It then refactors the memory.rs module in preparation for adding support for IO Address Spaces.

This PR should preserve the current behaviour.

@cazb2 cazb2 force-pushed the callumb_and_cheng/iommu_memory_refactor branch from c44dadb to d6ed718 Compare July 6, 2026 11:30
@cazb2 cazb2 marked this pull request as ready for review July 6, 2026 11:32
@cazb2 cazb2 force-pushed the callumb_and_cheng/iommu_memory_refactor branch from d6ed718 to 00f8ecc Compare July 6, 2026 11:34
@cazb2 cazb2 changed the title Continue IOMMU Work IOMMU: Continue Prior Work Jul 6, 2026
@cazb2 cazb2 force-pushed the callumb_and_cheng/iommu_memory_refactor branch 3 times, most recently from c8c04e3 to 78098d0 Compare July 7, 2026 00:53
cazb2 added 2 commits July 7, 2026 11:46
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>
@midnightveil midnightveil changed the base branch from main to pr_base_sdf_iommu_support July 7, 2026 02:54
@cazb2 cazb2 force-pushed the callumb_and_cheng/iommu_memory_refactor branch 6 times, most recently from fb824b9 to af71760 Compare July 7, 2026 12:37
A lot of the pre-existing logic was defining constants that are already
defined by seL4. This commit extracts those and includes them in the
Config struct that the tool passes around.

Based on the comments in the upcoming seL4 release,

```` Add new libsel4constant `seL4_UserVSpaceTop` which is a *inclusive*
value representing the highest available address available to user
level. The existing constant `seL4_UserTop` is a mix of inclusive and
exclusive across existing platforms, however, changing this to be
consistent would break userspace and require proof updates.  The
existing `seL4_UserTop` define is deprecated.
````
we should be able to extract the seL4_UserVSpaceTop and achieve the same
behaviour as the existing user_top function, in a less brittle way.

We can similarily extract information such as the vspace_index_bits
relevant for aarch builds, where the vspace_index_bits might be 10.

The remaining changes are removing constants that we already had access
to such as page bits and minimum page size, and implementing the json
parsing to obtain these constants.

Again this commit preserves existing behaviour.

Signed-off-by: Callum <c.berry@student.unsw.edu.au>
@cazb2 cazb2 force-pushed the callumb_and_cheng/iommu_memory_refactor branch from af71760 to 2a462da Compare July 7, 2026 23:38
@cazb2 cazb2 closed this Jul 7, 2026
@cazb2

cazb2 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Moved to au-ts fork.

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.

1 participant