Skip to content

Draft: Memory Cap Sharing#10

Draft
cazb2 wants to merge 4 commits into
mainfrom
callumb/memory_caps
Draft

Draft: Memory Cap Sharing#10
cazb2 wants to merge 4 commits into
mainfrom
callumb/memory_caps

Conversation

@cazb2

@cazb2 cazb2 commented Jul 23, 2026

Copy link
Copy Markdown

Sharing this as one possible design for the memory cap sharing discussions. Emphasising that it is only a sample approach that is almost certainly not the best. However there are so many possible approaches to implementing this functionality it seems like implementing different approaches and comparing each of them is one way to reach a good final design.

This approach allows the sharing of frame capabilities. This can be used to implement designs such as gdb, dynamic dma protection (the ability to make memory temporarily reachable via dma) and have pre allocated page table regions of memory where frames can be mapped at runtime once the physical addresses are known which is useful in x86 contexts (will require access to device untyped).

In terms of what it offers: support for accessing frames of any memory region, accessing iospace caps required for mapping and unmapping frames in an IO address space, accessing frames of any PDs stack along with the base virtual address (the size can be discovered from the sdf), accessing the frame for the ipc buffer of any PD, accessing the frames of a PDs elf along with the virtual address each frame is mapped at.

It also supports a new page table / io page table concept which will allocate the page tables but not the frames for a given virtual address region. This cleanly supports the actual mapping and unmapping of frames in an address space since currently the only way to ensure that the upper levels of page table are present is either through mapping a memory region and then overmapping it, or relying on the fact that by mapping in one 4KiB we know there will be room for 511 4KiB pages consecutive to it.

cazb2 added 4 commits July 23, 2026 13:47
This commit determines the size of the root cnode based upon the largest
slot number that is specified in the sdf.

Signed-off-by: Callum <c.berry@student.unsw.edu.au>
This commit unifies the way VM rights are encoded in the sdf.
Previously normal map perms were represented as a raw u8 while the iomap
perms were represented as a proper type.

Preserves existing behaviour.

Signed-off-by: Callum <c.berry@student.unsw.edu.au>
This is required to map frames at runtime.
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