10 Commits

Author SHA1 Message Date
Travis Geiselbrecht
f52ef453fe [tests][mmu] update the file a bit for C++, add another test
Make sure a page appears to be unmapped after it is told to.
2025-04-08 23:49:47 -07:00
Travis Geiselbrecht
7017a8fff9 [arch][mmu] add another routine to query if the arch supports user aspaces
Trim the arch mmu unit tests accordingly.

Should probably switch this to a #define, but it's possible some of
these queries could be dynamically detected (XN for example). May
revisit at some point.
2022-10-23 22:40:00 -07:00
Travis Geiselbrecht
5377fcbd12 [kernel][vm] add error handling with failed arch mmu mappings
In the 3 places in the upper VMM where it calls arch_mmu_map, try to
gracefully handle errors by unwinding the region creation.
2022-10-23 21:02:22 -07:00
Travis Geiselbrecht
3a6b43cb32 [arch][mmu][tests] slight tweaks 2022-10-21 01:35:28 -07:00
Travis Geiselbrecht
d5451cc8e6 [arch][tests] add a way to query some arch mmu features
Allow asking the arch layer if it supports NX pages or NS pages.
Have the arch mmu test code test accordingly.
Also tweak the tests to pass on arm32 mmu, which does not precisely
match the return semantics of the rest of the mmu routines on map/unmap.
2022-10-21 00:00:49 -07:00
Travis Geiselbrecht
0b5202362d [arch][mmu][test] change the arch mmu test file to c++
This lets us more easily use some C++ for test cleanup.
Updated the arch mmu flags to be explicitly unsigned to make C++
happier.
2022-10-20 23:24:33 -07:00
Travis Geiselbrecht
f6a2610aef [arch][mmu][test] update a few of the expects to asserts in these tests
In a few places where it's dangerous to proceed, raise to an assert so the
test stops.
2022-10-19 21:02:06 -07:00
Travis Geiselbrecht
dd438d2f1f [arch][test][mmu] add a simple test case to map a page and query the restult
Currently x86 fails the test but arm64 and riscv pass.
2021-12-05 23:24:04 -08:00
Travis Geiselbrecht
29d41272b0 [arch][mmu] add more test code to the mmu routines
Create a user space address space, map some pages, query the pages,
context switch, to the new aspace, access the pages.

Basic test that the aspace abstraction is working.

Will generate errors on some of the arches that dont fully implement all
of this, but not a crash.
2021-04-10 15:34:48 -07:00
Travis Geiselbrecht
3be4698671 [arch][test] add a new unittest for the arch mmu code
Just a skeleton at the moment, simply creates an arch aspace
and destroys it.
2021-03-30 02:48:59 -07:00