IOMMU: Add backend support for IOMMU#8
Open
cazb2 wants to merge 8 commits into
Open
Conversation
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
2 times, most recently
from
July 8, 2026 00:58
ad6a939 to
4fdc587
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_memory_refactor
branch
2 times, most recently
from
July 8, 2026 01:49
6a5c062 to
4df0221
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
7 times, most recently
from
July 8, 2026 09:22
6110e20 to
0f014d7
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_memory_refactor
branch
from
July 8, 2026 09:26
4df0221 to
4121642
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
2 times, most recently
from
July 8, 2026 10:22
54437dc to
f363700
Compare
midnightveil
reviewed
Jul 9, 2026
|
|
||
| env: | ||
| SEL4_VERSION: b7ef16a42d6d87b776462e66b8803365aea9f41d | ||
| SEL4_VERSION: b57b3de19526375eb63343f750b9720a3e20babf |
There was a problem hiding this comment.
Note that this also requires updates to seL4/microkit-manifest.
There was a problem hiding this comment.
| #include <stdint.h> | ||
|
|
||
| #include <microkit.h> | ||
| #include <sys/wait.h> |
There was a problem hiding this comment.
Erm, we don't have Linux, how does this work?
| #ifdef VTD_PT_INDEX_BITS | ||
| MICROKIT_CONSTANT(io_page_table_index_bits, VTD_PT_INDEX_BITS) | ||
| #ifdef seL4_IOPageTableIndexBits | ||
| MICROKIT_CONSTANT(io_page_table_index_bits, seL4_IOPageTableIndexBits) |
There was a problem hiding this comment.
Oh, I see this changed from here: #7 (comment)
| // The useable set of domain_ids can only be discovered through run-time errors in seL4. | ||
| // Crazy right! Mircokit tool does not support multiple devices sharing the same address | ||
| // space thus domain_id is not used by the Microkit tool. | ||
| domain_id: Word(0), |
There was a problem hiding this comment.
This will need to be changed as discussed.
| Object::PageTable(_) => "PageTable", | ||
| Object::AsidPool(_) => "AsidPool", | ||
| Object::IODevice(_) => "x86 IODevice", | ||
| Object::IOPT(_) => "x86 IOPageTable", |
| // SPDX-License-Identifier: BSD-2-Clause | ||
| // | ||
|
|
||
| use sel4_capdl_initializer_types::x86_io_address_space; |
There was a problem hiding this comment.
Please make this consistent with other imports.
| (Arch::X86_64, true) => self | ||
| .io_page_table_index_bits | ||
| .expect("Error: An x86 VT-D build should have VTD_PT_INDEX_BITS defined by seL4, captured in tool/microkit/object_sizes.h"), | ||
| .expect("Error: An x86 VT-D build should have seL4_IOPageTableIndexBits defined by seL4, captured in tool/microkit/object_sizes.h"), |
cazb2
force-pushed
the
callumb_and_cheng/iommu_memory_refactor
branch
from
July 9, 2026 03:15
4121642 to
6539123
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 03:23
f363700 to
4d27483
Compare
cazb2
changed the base branch from
callumb_and_cheng/iommu_memory_refactor
to
callumb_and_cheng/config_constants
July 9, 2026 03:25
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 03:31
4d27483 to
711827e
Compare
cazb2
force-pushed
the
callumb_and_cheng/config_constants
branch
2 times, most recently
from
July 9, 2026 03:43
caf67fe to
31069d2
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 03:44
711827e to
0f1363d
Compare
cazb2
force-pushed
the
callumb_and_cheng/config_constants
branch
from
July 9, 2026 03:49
31069d2 to
284c6d6
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 03:50
0f1363d to
91e685e
Compare
cazb2
force-pushed
the
callumb_and_cheng/config_constants
branch
from
July 9, 2026 03:56
284c6d6 to
08f27ce
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 03:56
91e685e to
86928dc
Compare
cazb2
force-pushed
the
callumb_and_cheng/config_constants
branch
from
July 9, 2026 05:18
08f27ce to
b8f5869
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 08:41
5073a85 to
2d8be3a
Compare
cazb2
force-pushed
the
callumb_and_cheng/config_constants
branch
from
July 9, 2026 08:49
658c8e4 to
5919e3f
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
2 times, most recently
from
July 9, 2026 08:51
b5c3336 to
54f9a05
Compare
cazb2
marked this pull request as ready for review
July 9, 2026 08:51
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 09:22
5366060 to
2e1b57e
Compare
cazb2
force-pushed
the
callumb_and_cheng/config_constants
branch
from
July 9, 2026 23:56
5919e3f to
84cec53
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 9, 2026 23:59
2e1b57e to
5a4cd2f
Compare
cazb2
force-pushed
the
callumb_and_cheng/config_constants
branch
from
July 10, 2026 00:54
84cec53 to
95dd28f
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
2 times, most recently
from
July 10, 2026 01:04
3c79207 to
342676a
Compare
cazb2
changed the base branch from
callumb_and_cheng/config_constants
to
callumb_and_cheng/iommu_memory_refactor
July 10, 2026 01:07
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 10, 2026 01:23
342676a to
829568e
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_memory_refactor
branch
from
July 10, 2026 01:25
2af2aab to
9ecdac4
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 10, 2026 01:26
829568e to
df27a19
Compare
cazb2
force-pushed
the
callumb_and_cheng/iommu_memory_refactor
branch
from
July 15, 2026 04:54
9ecdac4 to
73853c7
Compare
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>
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
3 times, most recently
from
July 15, 2026 06:02
b852552 to
1b6af52
Compare
Update microkit to use rust-sel4 with the new x86 IOMMU capdl support. Signed-off-by: Callum <c.berry@student.unsw.edu.au>
This commit adds a helper to extract the io page table index bits from the config. This currently only supports a IOMMU build on x86. Signed-off-by: Callum <c.berry@student.unsw.edu.au>
This commit implements support for the x86 IOMMU Capdl spec. The memory module is extended to allow for the construction of IOMMU address spaces. The Capdl spec refers to the IOSpace object as the IODevice object and the IO Page tables as IOPTs. Within microkit we use IOSpace to refer to the whole IO address space. It also provides an example using the qemu dma capable test device, demonstrating the use of the IOMMU. Note we did not need to provide physical memory addresses for any dma buffers, proving the IOMMU correctly translated our requests. Signed-off-by: Callum <c.berry@student.unsw.edu.au>
While seL4 does not support large pages to be used by the IOMMU, we will raise an error at the SDF parsing stage. Signed-off-by: Callum <c.berry@student.unsw.edu.au>
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 15, 2026 06:09
1b6af52 to
0f708aa
Compare
Integrate the new IOMMU support from the rust-sel4 capdl initialiser. Integrate the rust-sel4 PCI structure to avoid repeating definitions to improve code maintainability. The traits that we implement on the wrapper struct, make it easy to use the wrapper without having to worry about accessing the underyling type. Signed-off-by: Callum <c.berry@student.unsw.edu.au>
cazb2
force-pushed
the
callumb_and_cheng/iommu_microkit_backend
branch
from
July 15, 2026 06:25
0f708aa to
ba6cf23
Compare
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 logic for the creation of the IOMMU Capdl spec objects.
Adds an example demonstrating the use of the IOMMU.
Enables the IOMMU in the build_sdk.