Commit Graph

156 Commits

Author SHA1 Message Date
Zhang Junyang 4afac4d5ac Fix the cache coherent field as dead code 2024-06-25 12:20:18 +08:00
Zhang Junyang d520360512 Make tracked the metadata and kernel mappings 2024-06-25 12:20:18 +08:00
Zhang Junyang cab348349e Introduce `DynPage` and make page table map it 2024-06-25 12:20:18 +08:00
Zhang Junyang 40c32b5ff5 Refactor allocation APIs for pages and frames 2024-06-25 12:20:18 +08:00
Ruihan Li a1f36979d7 Replace `in_untracked_range` by `in_tracked_range` 2024-06-24 22:31:11 +08:00
Ruihan Li 52ee28880d Insert space lines for readability 2024-06-24 22:31:11 +08:00
Ruihan Li ebc9d04a1c Remove dead code and unused variables 2024-06-24 22:31:11 +08:00
Ruihan Li 414a3a389e Fix `Waiter`-related memory orders 2024-06-24 22:10:59 +08:00
Zhang Junyang 68793d28c5 Update the multiboot2 dependency
This relates to the upstream bug: https://github.com/rust-osdev/multiboot2/issues/215.
2024-06-21 10:57:08 +08:00
Zhang Junyang 05533d7afd Fix multiple documentation issues concerned by clippy 2024-06-21 10:57:08 +08:00
Zhang Junyang 4ba60271b1 Mute the unsafe macro clippy error of CPU local 2024-06-21 10:57:08 +08:00
Zhang Junyang 0515a8dc9a Fix an indexing problem in multiboot2 2024-06-21 10:57:08 +08:00
Zhang Junyang d6714c4b47 Fix multiple `Default` implementation caveats 2024-06-21 10:57:08 +08:00
Zhang Junyang ab1d931cb7 Adjust for Rust unstable feature's stability change 2024-06-21 10:57:08 +08:00
Zhang Junyang 5c524348de Update the dependency of unwinding to fix a `r#try` usage 2024-06-21 10:57:08 +08:00
Zhang Junyang 8e3212449c Fix the undefined behavior of transmute slices in VmIo 2024-06-21 10:57:08 +08:00
Jianfeng Jiang ef075d15d0 Sets the default scheduler in aster_frame 2024-06-20 19:15:19 +08:00
Zhang Junyang 18cc7f0a6b Fix the UB in parsing multiboot1 memory areas 2024-06-20 19:01:50 +08:00
Qingsong Chen 146a91a45e Upgrade trapframe
Fix #842.
Access FS/GS base with the FSGSBASE instructions.
2024-06-20 18:38:33 +08:00
Hsy-Intel 040e53a3a8 Fix issues for running TDX 2024-06-18 13:13:05 +08:00
nishirong 2ceba78d47 Refactor alloc_single API for page and frame 2024-06-18 12:47:15 +08:00
Shaocong Sun 69f0954271 Fix DMA coherent 2024-06-13 23:17:15 +08:00
Zhang Junyang 840729d960 Temporarily raise linear mapping cap to workaround TDX IO 2024-06-13 10:04:51 +08:00
Zhang Junyang 3c9ab308e1 Add the protect functionality in the boot page table for TDX 2024-06-13 10:04:51 +08:00
Zhang Junyang 5ba3f9a1a9 Make global the boot page table 2024-06-13 10:04:51 +08:00
Zhang Junyang 5c7c1bb39b Make earlier the initialization of the kernel page table 2024-06-13 10:04:51 +08:00
Jianfeng Jiang 33a7da9991 Fix typos in API documentation 2024-06-09 22:57:14 +08:00
Jianfeng Jiang 6e59617fc7 Add missing docs in aster-frame 2024-06-09 22:57:14 +08:00
Jianfeng Jiang e192579405 Fix broken link in documentation 2024-06-09 22:57:14 +08:00
YanWQ-monad e8c8c027c5 Declare `kernel_task_entry` as `extern "C"` 2024-06-07 16:59:29 +08:00
Ruihan Li e0c6c29481 Fix memory leak of `Task` structures 2024-06-04 14:47:18 +08:00
Ruihan Li ff83ce7667 Deny `dead_code` and `unused_variables` at crate level 2024-06-04 10:25:45 +08:00
Ruihan Li 9107a1771e Allow `dead_code` and `unused_variables` at file level 2024-06-04 10:25:45 +08:00
Zhang Junyang 232e62b053 Redo segment with `Arc` rather than creating `SegmentHeadMeta` 2024-06-03 22:16:02 +08:00
Zhang Junyang 3fa3d7f15a Revised page table activation and drop management 2024-06-03 22:16:02 +08:00
Zhang Junyang 7095b37e7e Refactor the source structure in `aster_frame::mm` 2024-06-03 22:16:02 +08:00
Zhang Junyang e8595b95fe Add missing safety explanations for the page table node 2024-06-03 22:16:02 +08:00
Zhang Junyang 3579d88aa6 Fortify the metadata memory model and adjust the `Page` casting APIs 2024-06-03 22:16:02 +08:00
Zhang Junyang 14e1b1a9fc Rename various concepts related to memory management 2024-06-03 22:16:02 +08:00
Zhang Junyang 03a39c94ca Refactor the representation of page metadata 2024-06-03 22:16:02 +08:00
Zhang Junyang 39aa31a69d Remove the `VmIO` implementation of `VmSpace` 2024-06-03 22:16:02 +08:00
Zhang Junyang 141fbeaf0c Optimize the page table implementation using the frame metadata
This PR also refactored the page table cursor, distinguishing `Cursor` from `CursorMut`, and split
a lot of functions to reduce dynamic condition checking.

There are also other sanitizations performed, including refactoring PTE's `is_huge` API to `is_last`,
hardening tracked mapping checks, and making `VmFrame` any size.
2024-06-03 22:16:02 +08:00
Zhang Junyang 69d464fc6b Use metadata to track `VmFrame`s
In this commit, the frame metadata storage schema is implemented. The bootstrap process is refactored
and a boot page table is introduced to perform early stage metadata mapping. The metadata is then used
to track `VmFrame`s instead of the former `Arc` approach.
2024-06-03 22:16:02 +08:00
Chen Chengjun c84efe7a90 Introduce CPU clock and CPU timer 2024-06-03 20:03:46 +08:00
Chen Chengjun f1c1011f2b Set PROCESSOR cpu-local 2024-06-03 20:03:46 +08:00
Ruihan Li 0bafc0f18a Add unit tests for `WaitQueue` and `Waiter` 2024-06-03 15:45:56 +08:00
Ruihan Li a664f1a9fc Revise the public APIs of `WaitQueue` 2024-06-03 15:45:56 +08:00
anbo 140640c5d6 Modify CR3 solely during context switching 2024-06-03 15:37:11 +08:00
jellllly420 e1480f94ee fix: enable timely delivery of POSIX signals while busy-looping 2024-06-01 20:08:11 +08:00
Fabing Li 34e9d71fe4 Add condition variable implementation 2024-05-31 20:25:31 +08:00