Blaisorblade wrote:
Hmm, no, that's not what SKAS allows. It simply allows to switch to *another* address space. Yes, you can make arbitrary mmaps, so to replicate the original address space and add some other maps, that you access even through %fs if you want.Thanks. I will implment an emulator through this mechanism. My current mechanism performs:
But that's nothing special to SKAS; the advantage it gives is that:
a) the parent can easily alter the child's address space (not the original one it inherits at startup, but only the newly created one).
b) the parent can switch the child's current address space through PTRACE_SWITCH_MM (this could be emulated with running many childs).
loadByte(addr) { pte = addr >> 12; offset = addr & 0xFFF; result = memory[ptr][offset] }
you can imagine the store... mechanisms. Obviously the cost of the ptrace calls is going to be a slow down compared to this.
I hope to look into creating a patch to allow multiple segments in a linux process. So an extension to skas on i386 and I can get my %fs wish :-)
btw: a similar thing should be possible on PowerPC given that segmentation can be disabled for either or both the instruction and data cache. It would be neat to wrap this up in a module for the performance improvement of emulators.
Now, the example almost work. The child can execute the syscalls, even if the verification of the datas it gets is currently failing (I'll be verifying that later).Glad it was useful and thanks for your help - it's taught me what to do for my emulator code. I hope I can post some more things back in the future. Would the multi-segment stuff be useful for more people? Is there an obvious reason to avoid multi-segments?
The main problem yesterday's version had was that the mmap's had a offset of 0, since the asid_mmap() loops will always stop at the first entry of AddressSpaces[ASID].map_info, which had a 0 offset. Currently I set the offset equal to the virtual address it's mapped to.
Thanks a lot for posting the original version: the finished one will be very useful for the testing of SKAS for x86-64, to debug it and get it working soon. Bye
Regards,
Ian Rogers
------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel