summaryrefslogtreecommitdiff
path: root/DevTools/UserspaceEmulator/SoftMMU.h
AgeCommit message (Collapse)Author
2020-07-16UserspaceEmulator: Don't scan text segment for malloc leaksAndreas Kling
There will be no (true positive) malloc addresses in the text segment.
2020-07-16UserspaceEmulator: Add TLS regions to reachability checkingAndreas Kling
2020-07-16UserspaceEmulator: Implement very basic leak checking :^)Andreas Kling
Upon exit, the emulator will now print a leak report of any malloc allocations that are still live and don't have pointers to their base address anywhere in either another live mallocation, or in one of the non-malloc-block memory regions. Note that the malloc-block memory region check is not fully functional and this will work even better once we get that fixed. This is pretty cool. :^)
2020-07-16UserspaceEmulator: Add ways to check if a Region is stack/mmapAndreas Kling
2020-07-15UserspaceEmulator: Add support for shared buffers (shbuf)Andreas Kling
We track these separately from regular mmap() regions, as they have slightly different behaviors.
2020-07-13UserspaceEmulator: Add a very simple instruction fetch cacheAndreas Kling
To avoid MMU region lookup on every single instruction fetch, we now cache a raw pointer to the current instruction. This gets automatically invalidated when we jump somewhere, but as long as we're executing sequentially, instruction fetches will hit the cache and bypass all the region lookup stuff. This is about a ~2x speedup. :^)
2020-07-13UserspaceEmulator: Add some more syscallsAndreas Kling
We can now unmap mapped memory, among other things. This is all very ad-hoc as I'm trying to run UserspaceEmulator inside itself. :^)
2020-07-12UserspaceEmulator: Add some convenient SoftMMU APIs for copying dataAndreas Kling
We'll soon want to copy data in and out of the SoftMMU memory space.
2020-07-12UserspaceEmulator: Add basic TLS (thread-local storage) supportAndreas Kling
The SoftMMU now receives full X86::LogicalAddress values from SoftCPU. This allows the MMU to reroute TLS accesses to a special memory region. The ELF executable's PT_TLS header tells us how to allocate the TLS. Basically, the GS register points to a magical 4-byte area which has a pointer to the TCB (thread control block). The TCB lives in normal flat memory space and is accessed through the DS register.
2020-07-10UserspaceEmulator: Add 8/16 bit memory read/write operationsAndreas Kling
2020-07-09UserspaceEmulator: Start sketching out a SoftMMU class :^)Andreas Kling
This Emulator sub-object will keep track of all active memory regions and handle memory read/write operations from the CPU. A memory region is currently represented by a virtual Region object that can implement arbitrary behavior by overriding read/write ops.