Hello Mark, >From what I understand, the virtual address of a given page table should not change when accessing from vtopte() and pmap_pte().
However, with small code change in pmap_remove_pages(), I was able to print the values returned by these two functions. vtopte() and pmap_pte(), pte1 0xffff8000006432e0 pa1 346941425 m1 0xffffff04291cf600, pte2 0xffffff03463032e0 pa2 346941425 m2 0xffffff04291cf600 pte1 0xffff8000006432e8 pa1 346842425 m1 0xffffff04291c7e78, pte2 0xffffff03463032e8 pa2 346842425 m2 0xffffff04291c7e78 pte1 0xffff8000006432f0 pa1 346863425 m1 0xffffff04291c8df0, pte2 0xffffff03463032f0 pa2 346863425 m2 0xffffff04291c8df0 In the above result, the pte1 is the result of vtopte() and pte2 is the result of pmap_pte(). Interestingly, the value of these two virtual addresses pte1 and pte2, result in the same physical address pa1 == pa2. If I am not wrong, the page tables are now mapped in two different virtual addresses? Could you please clarify this? Thanks, Vasanth On Tue, Apr 3, 2012 at 3:18 PM, Mark Tinguely <marktingu...@gmail.com>wrote: > On Tue, Apr 3, 2012 at 1:52 PM, vasanth rao naik sabavat > <vasanth.raon...@gmail.com> wrote: > > Hello Mark, > > > > I think pmap_remove_pages() is executed only for the current process. > > > > 2549 #ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY > > 2550 if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { > > 2551 printf("warning: pmap_remove_pages called with > non-current > > pmap\n"); > > 2552 return; > > 2553 } > > 2554 #endif > > > > I dont still get it why this was removed? > > > > Thanks, > > Vasanth > > > That is pretty old code. Newer code does not make that assumption. > > Without the assumption that the pages are from the current map, then you > have to use the direct physical -> virtual mapping: > > 2547 #ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY > 2548 pte = vtopte(pv->pv_va); > 2549 #else > 2550 pte = pmap_pte(pmap, pv->pv_va); > 2551 #endif > > --Mark Tinguely. > _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"