On Sun, Jun 27, 2010 at 9:20 PM, Venkatram Tummala <venkatram867@xxxxxxxxx> wrote: > > > On Sun, Jun 27, 2010 at 9:18 AM, sam shepperd <samshepperd@xxxxxxxxx> wrote: >> >> How can I found out the mm_struct or PTE for a given virtual address >> (0xCxxxxxxx)? >> >> I can use virt_to_page(virtual_address) to return a struct page, but then >> what can I do with the struct page? I cannot use rmap's >> page_check_address() because I do not have a struct mm_struct. >> >> Kindly thanks, >> Sam > > I am not exactly sure as to what you mean by finding mm_struct for a virtual > address. Virtual address is not a unique number. The same virtual address > may belong to any process, and hence to any mm_struct. There is no > one-to-one relation between a virtual address & mm_struct object. However, > the (mm_struct, Virtual Address) pair is a unique number. > > You can always get the mm_struct of the currently executing process by > "current->mm", if thats what you meant by "finding the mm_struct". > > Now, about finding the PTE for the virtual address. > > pte_t *find_pte(unsigned long addr) > > Hope that helps. > > Venkatram Tummala Kindly thanks - that helps. However the virtual address of the kernel symbol I am looking up in memory is not within current->mm. I may try walk through all of the mm_struct searching for the virtual address. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ