Memory write tracing/logging of an application / Watchpoints in Genode/Fiasco.OC

Stark, Josef j.stark at ...256...
Fri Jan 12 16:51:28 CET 2018


Hi all, hello Martin,

first of all, thank you for the rapid fix.

So since I only need a tiny fraction of Vinit (the device emulator), some time ago 
I decided that it would be easier for my project to only 'reintegrate' the stuff I need 
from Vinit into Genode 16.08 instead of porting the whole thing. Basically I create 
a child from my parent and register as pager. When my child requests a dataspace, 
I take note of size and address but don't actually create one. So then each time 
my child accesses data, I get notified via a pagefault. Then, with each PF, 
I would need to do 4 basic steps:

1. Get instruction pointer and decode instruction
2. Simulate memory access, redundantly
3. Increase instruction pointer
4. Resume child without ever attaching the dataspace

First, I experimented with my own solo app but then moved to adapt our existing 
checkpointing app rtcr accordingly [1] [2], since I figured that later I could reuse 
some parts of it for C/R.
Step 4 is relatively easy and already working, so I now have an app that pagefaults 
and gets resumed repeatedly at the same address and ip since I couldn't implement 
the rest of the steps so far. The reason is that I can't figure out how to access the 
Thread_state of the thread causing the pagefault. The Vinit uses an imprint written 
into the State that can be used to correlate an RM client to the pagefault State. I'm 
trying to integrate this imprint as well, but I'm struggling because obviously since 
the creation of Vinit the genode architecture has changed quite a bit (at least for a 
newcomer like me). E.g. I'm having trouble corresponding the required changes 
from [3] to add_client() to the 16.08 version (it exists in a different place with a 
different signature and a much smaller body).

So I'm wondering if maybe in the meantime there exists an easier way to access 
the IP (and other registers) of a pagefaulting thread from within the fault-handler 
(in my example _handle_fault in [4])? Especially considering that my parent task 
has only this one child (with currently only 1 thread), if that makes it easier.

Thank you.

Best regards,
Josef


[1] https://github.com/jmstark/genode (Base OS modifications required for rtcr)
[2] https://github.com/jmstark/rtcr (rtcr, to be cloned into repos)
[3] https://github.com/jmstark/genode_hdl_env/commit/79014e19861a7b02f028c6b5918148bbc7f06e18?diff=unified
[4] https://github.com/jmstark/rtcr/blob/red_mem/src/rtcr/intercept/ram_session.cc



More information about the users mailing list