Commit Graph

16 Commits

Author SHA1 Message Date
4lDO2 0aa7fea250 Fix remap bug: require present before remapping. 2023-07-17 13:31:46 +02:00
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 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 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
Jeremy Soller 1214f3dcdc Add PageFlags to abstract differences between architectures 2021-01-14 10:01:36 -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 fb88d1669f Add unmap function 2020-09-08 19:59:13 -06:00
Jeremy Soller 5990a04e13 Rename Mapper::active to Mapper:make_current 2020-09-08 15:13:01 -06:00
Jeremy Soller e8ea483832 Add page flushing, add support for mapping anonymous pages 2020-09-08 14:56:57 -06:00
Jeremy Soller db7869d995 Add table function for mapper, to get inner page table 2020-09-08 13:52:22 -06:00
Jeremy Soller 1b58d2a956 Add FrameCount struct, improve zeroing page performance 2020-09-08 11:13:49 -06:00
Jeremy Soller fcb64422c4 Add FrameAllocator trait, move frame allocator and mapper to library 2020-09-08 10:52:52 -06:00