Commit Graph

94 Commits

Author SHA1 Message Date
Jeremy Soller 61ba2e6c8e Fix unmap_parents 2022-08-22 18:49:32 -06:00
Jeremy Soller 0d4ff5d4f3 Add functions for accessing mapper allocator 2022-08-21 13:20:44 -06:00
Jeremy Soller df733ed571 Use TableKind for most table operations 2022-08-20 13:00:48 -06:00
Jeremy Soller c5eb435d79 Match PHYS_OFFSET accross archs 2022-08-19 20:53:15 -06:00
Jeremy Soller e05868e1dc Improve aarch64 paging instructions 2022-08-19 19:52:00 -06:00
Jeremy Soller e9950ee6da Fix more warnings 2022-07-29 18:53:12 -06:00
Jeremy Soller 23d4995e50 Fix warnings 2022-07-29 18:37:37 -06:00
4lDO2 5700899e9a Merge branch 'migrate_kernel_to_rmm' into 'master'
Add necessary functionality for migrating kernel paging code to RMM

See merge request redox-os/rmm!6
2022-07-27 15:10:52 +00:00
4lDO2 9462df03e7 Add support for unmapping parents.
Currently, this uses a relatively naive method of simply scanning the
512 entries for the PRESENT flag. But, unless the optimizer cannot, it
can be reduced to calculating the bitwise OR of every entry and then
checking that.

If this turns out to be too slow, which it might be when unmapping lots
of pages, then we can (1) either fall back to using a counter like the
old paging code did, or even better (2) use the now-1:1 grants tree to
check if it became empty. Putting the grants code in RMM might be
suboptimal, so instead we can add "unmap_range" and have the kernel
paging code take the offset of the next grant, if any, and then possibly
unmap entire P1s/P2s/P3s -- whatever is in the page tables within that
range.

Note that I am fairly certain that method (1) was the cause of the
visually notorious orbital memory corruption bug.
2022-07-27 10:49:49 +02:00
4lDO2 229ae5da40 Add remaining interfaces to user RMM for user mem. 2022-07-27 10:49:49 +02:00
4lDO2 efc67a2012 Use wrapped flags for PageEntry. 2022-07-27 10:49:49 +02:00
4lDO2 fad6afa7d8 Flush on Drop, unless explicitly ignored. 2022-07-27 10:49:49 +02:00
4lDO2 7a209c83c9 Implement Debug for X8664Arch. 2022-07-27 10:49:49 +02:00
4lDO2 c847b1e2a8 Implement FrameAllocator for mutable refs of impls. 2022-07-27 10:49:49 +02:00
4lDO2 2f16dddf25 Add a page flusher trait. 2022-07-27 10:49:49 +02:00
Jeremy Soller 0944b17983 Add initial x86 32-bit support 2022-07-26 20:13:55 -06:00
Jeremy Soller ec284ca8e3 Update rust-toolchain 2022-07-26 19:01:42 -06:00
Jeremy Soller 507f7ccd4a Merge branch 'update-toolchain-2022' into 'master'
Update to latest toolchain.

See merge request redox-os/rmm!5
2022-03-23 18:06:11 +00:00
4lDO2 e2648005ba Update to latest toolchain. 2022-03-06 11:34:22 +01:00
Jeremy Soller 37e88ff4d3 Merge branch 'virt_is_canonical' into 'master'
Add Arch::virt_is_valid

See merge request redox-os/rmm!4
2021-07-11 21:33:34 +00:00
4lDO2 6bc59e7013 Remove virt_kind, impl virt_is_valid() for riscv.
All there is left now is AArch64.
2021-07-08 16:06:51 +02:00
4lDO2 b75c329a27 Add virt_kind and virt_is_valid for emulation. 2021-07-08 13:35:51 +02:00
4lDO2 32caee3095 Add arch functions for checking canonical addrs. 2021-07-08 13:27:08 +02:00
4lDO2 c66956ca2a Remove unused #![feature(const_fn)]. 2021-06-17 18:42:03 +02:00
Jeremy Soller c81c4de223 Add method to get TableKind from VirtualAddress 2021-05-04 08:10:44 -06:00
Jeremy Soller 5e47692b8d Support more operations on PageFlags 2021-05-04 08:10:44 -06:00
Jeremy Soller 2f74326384 Add riscv64 sv39 and sv48 2021-05-04 08:10:34 -06:00
Jeremy Soller c46d148e26 Fix tests for aarch64 2021-05-02 21:25:27 -06:00
Jeremy Soller 7fd1218465 Merge remote-tracking branch 'origin/aarch64-rebase' 2021-04-13 19:12:48 -06:00
Jeremy Soller 132d91d3aa Fixed page flags for aarch64 2021-01-14 15:54:51 -07:00
Jeremy Soller cb6b44d69e Use devmap offset for physmap on aarch64 2021-01-14 12:35:27 -07:00
Jeremy Soller 1214f3dcdc Add PageFlags to abstract differences between architectures 2021-01-14 10:01:36 -07:00
Jeremy Soller c5774c5529 Add TableKind for future use 2021-01-14 09:16:46 -07:00
Jeremy Soller dafd9cb3c4 Add ENTRY_FLAG_DEFAULT_PAGE and ENTRY_FLAG_DEFAULT_TABLE 2021-01-14 09:16:37 -07:00
Jeremy Soller fad48af985 WIP: aarch64 support 2021-01-13 10:47:35 -07:00
Jeremy Soller b1c7b9638d Merge branch 'fix-repr-packed' into 'master'
Fix possible UB by implementing Copy and Clone manually for BuddyEntry.

See merge request redox-os/rmm!1
2020-12-20 16:08:31 +00:00
4lDO2 9a716604fc Implement Copy and Clone manually for BuddyEntry.
This fixes a warning that may in the future become an error, about the
possibility for unaligned references, since the derive macros apparently
rely on creating references to fields. Unaligned references are direct
UB.
2020-12-20 16:36:52 +01:00
Jeremy Soller cdbeecfffe Remove some warnings 2020-09-14 09:47:29 -06:00
Jeremy Soller 936352a049 FrameCount::new function 2020-09-14 09:47:23 -06:00
Jeremy Soller 8e0df608e2 Add allocator usage information 2020-09-14 09:41:56 -06:00
Jeremy Soller e94d7e7772 Rewrite buddy allocator 2020-09-14 09:41:42 -06:00
Jeremy Soller a775c9e987 Require Arch to implement Clone and Copy 2020-09-14 09:08:28 -06:00
Jeremy Soller a12be1b172 Keep track of last free page 2020-09-09 20:19:28 -06:00
Jeremy Soller f17a1b52bd Test multi-page allocation 2020-09-09 16:02:59 -06:00
Jeremy Soller 0c44dde349 Implement multi-page allocations in buddy allocator (poorly) 2020-09-09 16:02:44 -06:00
Jeremy Soller 711414223b Fix buddy map footer read address 2020-09-09 11:11:39 -06:00
Jeremy Soller fed3110ae8 Better unimplemented messages 2020-09-09 10:55:29 -06:00
Jeremy Soller 811dd09de4 Remove unused function for empty buddy allocator 2020-09-08 20:20:56 -06:00
Jeremy Soller fb88d1669f Add unmap function 2020-09-08 19:59:13 -06:00
Jeremy Soller e6d93d5743 Allow const creation of buddy allocator 2020-09-08 15:51:13 -06:00