maestro wrote:
> You might want to consider useing the Page Directory Base Register (PDBR
> aka cr3 or in qemu-x86 env->cr[3]) to idenify differnet processes. afaik
> it is then OS-dependant how to get the corresponding PID. I did this for
> windows and i assume it's a lot easier to do the same for linux/*BSD (as
> the source is available). Since you probably will need to check for the
> current process quite often, the shorter access times for this
> information might come in handy.

Good idea.

However, on Linux cr3 is not updated for every process.  Specifically,
it is not updated for kernel threads which don't have any user-space
mappings of their own.  This is to avoid unnecessary TLB flushes.

-- Jamie


_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to