Commit Graph

135 Commits

Author SHA1 Message Date
4lDO2 bb30530ea0 Track which CPUs are using any given AddrSpace. 2024-03-04 19:03:00 +01:00
Jeremy Soller 45f1c4e29e Add rustfmt from relibc and apply it with cargo fmt 2024-01-17 13:52:01 -07:00
4lDO2 ee3aafa1d9 Remove PhysBorrowed hacks. 2023-12-15 15:14:40 +01:00
4lDO2 d4a120188f Ensure PhysBorrowed iff !alloc-owned, vice versa.
This is allowed now that the old physalloc/physfree syscalls have been
removed.
2023-12-15 15:14:40 +01:00
4lDO2 a42e406569 Fix contiguous mmap. 2023-12-15 15:14:40 +01:00
4lDO2 77400f63ee Add a memory: file for phys-contiguous mmaps. 2023-12-15 15:14:36 +01:00
bjorn3 2d065083df Use HashMap instead of BTreeMap where possible
This shrinks the kernel from 905840 bytes to 862408 bytes.
2023-12-13 19:55:20 +01:00
4lDO2 88508a2cb7 Remove as_user_inner. 2023-12-13 11:08:12 +01:00
4lDO2 679c26c03b s/Arc<dyn KernelScheme>/enum, but deref as dyn. 2023-12-13 11:08:07 +01:00
bjorn3 017702d3d2 Remove a lot of dead code 2023-12-12 15:01:29 +00:00
4lDO2 f025ece614 Replace from/into with get/new when necessary. 2023-09-06 08:38:10 +02:00
4lDO2 8f98d5b987 Extend mremap, eager mappings for real hardware. 2023-08-03 12:37:58 +02:00
4lDO2 c7714992f3 Fix clone_grant_using_fmap test. 2023-08-02 14:17:26 +02:00
4lDO2 2070fa44b7 Fix warnings. 2023-08-02 13:07:49 +02:00
4lDO2 05a9530ac7 Temporarily disable CoW fmaps. 2023-08-01 17:29:36 +02:00
4lDO2 fe88b23d09 Use a single cow zeroed page for RO maps + eager mapping. 2023-08-01 13:11:00 +02:00
4lDO2 ec9c24f841 WIP: aarch64 2023-07-27 19:05:33 +02:00
4lDO2 3cfec39b47 Pass MunmapFlags to scheme. 2023-07-25 10:52:24 +02:00
4lDO2 c9aa5ca851 WIP: Add SYS_MREMAP. 2023-07-25 10:52:24 +02:00
4lDO2 2660c3e07a WIP: Pin fmap grants that are borrowed too.
This might not be the most ideal solution, since a GiB grant can be
EBUSY blocked if a single page is used by an indefinitely-blocking
UserScheme. But, the alternatives would impose lots of additional
complexity, such as increasing the PageInfo size, adding more
refcounting arrays to grants, etc.
2023-07-25 10:52:24 +02:00
4lDO2 e2b736140f Make PageInfo atomic once again. 2023-07-25 10:52:24 +02:00
4lDO2 d58ddc35fe Complete PageInfo cleanup.
This enables proper CoW ^ shared enforcement, so that e.g. acquiring a
new CoW page from already shared memory, or vice versa, will enforce
that they aren't both simultaneously.
2023-07-25 10:52:23 +02:00
4lDO2 0f1b5b9b6f WIP: Make cow/shared refcounts mutually exclusive. 2023-07-25 10:52:23 +02:00
4lDO2 113cb5ed4e Ensure pages cannot be both CoW and shared. 2023-07-25 10:52:23 +02:00
4lDO2 d3ecedefd9 Notify schemes when mmaps are unmapped. 2023-07-25 10:52:23 +02:00
4lDO2 02f04752e8 Use proper locks for PageInfo. 2023-07-25 10:52:23 +02:00
4lDO2 afa3d7dc7b Support anonymous MAP_SHARED mmaps. 2023-07-25 10:52:23 +02:00
4lDO2 70b4d99c96 Implement MAP_FIXED without MAP_FIXED_NOREPLACE. 2023-07-25 10:52:23 +02:00
4lDO2 f0341280f7 Fix frame deallocation. 2023-07-25 10:52:23 +02:00
4lDO2 cbec83215a Lazy-evaluate pages returned by fmap. 2023-07-25 10:52:22 +02:00
4lDO2 9182722f84 WIP: Allow listing address space grants again. 2023-07-25 10:52:22 +02:00
4lDO2 ba62c0606e Pin PhysBorrowed head/tail UserScheme grants too. 2023-07-25 10:52:22 +02:00
4lDO2 329d60848c WIP: Support CoW fmap. 2023-07-25 10:52:22 +02:00
4lDO2 b24cf821c2 Support transferring grants again. 2023-07-25 10:52:22 +02:00
4lDO2 55f1829e77 Call funmap if applicable. 2023-07-25 10:52:22 +02:00
4lDO2 4ec8712fb0 Adjust fmap offsets in Grant::extract. 2023-07-25 10:52:22 +02:00
4lDO2 c5eb44d968 Increase refcount for borrowed fmap too. 2023-07-25 10:52:22 +02:00
4lDO2 b3a6a6744a Pin grants that are used in UserScheme. 2023-07-25 10:52:22 +02:00
4lDO2 954a8d00fe Make page fault handler recursive.
This is probably a bad idea, but it works for now, and can only cause
problems, if grants that borrow grants that borrow grants etc., are
used.
2023-07-25 10:52:21 +02:00
4lDO2 da6f6a316c Return only one grant, External, for Grant::borrow. 2023-07-25 10:52:21 +02:00
4lDO2 b5430359d8 Forbid scheme calls with non-RAM physmapped memory. 2023-07-25 10:52:21 +02:00
4lDO2 43c433a3f0 Remove FmapCtxt. 2023-07-25 10:52:21 +02:00
4lDO2 8553bc7a59 WIP: Support userspace-backed borrowing mmaps. 2023-07-25 10:52:21 +02:00
4lDO2 024f3e3828 Fix deadlock, booting to shell works now. 2023-07-25 10:52:21 +02:00
4lDO2 ad78dcc5a1 WIP: Rudimentary MAP_SHARED fmap implementation. 2023-07-25 10:52:21 +02:00
4lDO2 23fede5db0 Remove scheme funmap methods. 2023-07-25 10:52:20 +02:00
4lDO2 0c365f54e6 WIP: FmapBorrowed. 2023-07-25 10:52:20 +02:00
4lDO2 20c3adf38d WIP: Start rewriting fmap impl. 2023-07-25 10:52:20 +02:00
4lDO2 99975c0e42 WIP: Ensure that Grant::borrow does not borrow nonpresent grants. 2023-07-25 10:52:20 +02:00
4lDO2 dffc8ec9fc Do not expect PageInfo for PhysMap grants. 2023-07-25 10:52:20 +02:00