> > When debugging (via gdbstub), I would like to get the current process > > id by a virtual address. When the virtual address is in the > > user-space, the only way to find the current task_struct I can think > > of is to iterate over all the task_struct's (assuming we know > > task_init and the offsets of the relevant fields), and compare > > task->mm->pgd against the current PGD.
Coming back to this problem... Reading ttbr0 worked for me on ARM, reading cr3 worked on x86. Now I'm looking for a similar thing on MIPS. I.e. I need a pointer to the process' translation table - something that can be compared to task->mm->pgd (after virt2phys conversion). I'd appreciate any idea!