Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of arch-specific address space granules #35

Open
pittma opened this issue Jul 9, 2019 · 3 comments
Open

Make use of arch-specific address space granules #35

pittma opened this issue Jul 9, 2019 · 3 comments

Comments

@pittma
Copy link
Contributor

pittma commented Jul 9, 2019

  • aarch32
    • section
    • super section
  • aarch64
    • large page
    • huge page
@pittma pittma changed the title Make use of arch-specific granules Make use of arch-specific address space granules Jul 9, 2019
@pittma
Copy link
Contributor Author

pittma commented Jul 9, 2019

A thought that occurred to me when thinking about this: I think I'd like to type-alias granules.

// vspace.rs

type UnmappedPage<Kind> = UnmappedRegion<U12, Kind>;
type MappedPage<Kind> = MappedRegion<U12, Kind>;

#[cfg(target_arch = "aarch64")]
type UnmappedLargePage<Kind> = UnmappedRegion<U21, Kind>;
#[cfg(target_arch = "aarch64")]
type MappedLargePage<Kind> = MappedRegion<U21, Kind>;
// &c.

The reason for this is that I'd like to make all of arch pub(crate). When debating with myself on this, it occurrs to me that it's possible that this complicates mapping these regions in terms of what goes in the caps member of *Regions, but I like the notion of hiding arch things behind the region types. One possible solution is the use of existential types.

@pittma
Copy link
Contributor Author

pittma commented Jul 17, 2019

Actually, disregard that previous comment regarding type aliasing granules. The "I'd like to make all of arch pub(crate)" stands, though.

To hold on to the granule caps once we know how to map them, we can just use a Granule type from which we can retrieve the cptr, the vaddr, and call unmap on—that's what should go into the caps member of MappedMemoryRegion, not PageRange.

This all, of course, depends on us being able to actually map those granules which is still an open question.

@pittma pittma self-assigned this Jul 26, 2019
@pittma pittma removed their assignment Aug 7, 2019
@pittma
Copy link
Contributor Author

pittma commented Aug 7, 2019

I encountered a complication in the "recursive" mapping algorithm as it pertains to mapping larger memory granules. While we can ensure that mapping is possible through the recursion as an artifact of address alignment, we cannot, when unrolling that recursion, know when to stop at a specific layer and invoke the leaf-mapping syscall (seL4_<ARCH>_Page_Map). Doing so causes the Maps implementations to become more complex as they would need to discern what's being mapped, invoke the leaf mapper, and then signal to the caller that the recursion should stop.

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

No branches or pull requests

1 participant