hi, what''s the best way (if at all) to iterate through all of a domain''s page tables within xen 2.0.6? i need to find all references to a specific pte value (which is a given). essentially, a reverse page-table lookup. i''m hesitant to switch to 3.0, but if it''s easier to do what i want, just let me know. thanks, -A. -- Aaron Marks Distributed Systems Lab University of Pennsylvania www.cis.upenn.edu/~ajmarks "Strange women lying in ponds distributing swords is no basis for a system of government." _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 15 Nov 2005, at 15:17, Aaron J. Marks wrote:> what''s the best way (if at all) to iterate through all of a domain''s > page > tables within xen 2.0.6? i need to find all references to a specific > pte > value (which is a given). essentially, a reverse page-table lookup. > > i''m hesitant to switch to 3.0, but if it''s easier to do what i want, > just > let me know.tools/libxc/libxc_linux_save.c has an example of pausing a domain and then getting information about every one of its pages, including type info. You can then filter on pagetable pages and scan them. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 11/15/05, Aaron J. Marks <ajmarks@seas.upenn.edu> wrote:> hi, > > what''s the best way (if at all) to iterate through all of a domain''s page > tables within xen 2.0.6? i need to find all references to a specific pte > value (which is a given). essentially, a reverse page-table lookup.This is not something you wish to do in a production system, though I can imagine situations where this would be useful for debugging. Basically, you will have to instrument Xen with a n-level nested loop, that does something like (show here for 2-level x86-32 ptes): unsigned long* pgd = map_domain_page(d->arch.mm->pgd) for(i=0; i<HYPERVISOR_VIRT_START>>22; i++) { if( pgd[i] & _PAGE_PRESENT) { unsigned long* ptes = map_domain_page( pgd[i]>>12); for(j=0; j<1024; j++) { if( ptes[j] & _PAGE_PRESENT && ptes[j]>>12==my_mfn) { printk("found it!\n"); } unmap_domain_page(ptes); } } Good luck, Jacob -- Save time and bandwidth with EDelta: http://www.diku.dk/~jacobg/edelta/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 15 Nov 2005, Keir Fraser wrote:> > On 15 Nov 2005, at 15:17, Aaron J. Marks wrote: > > > what''s the best way (if at all) to iterate through all of a domain''s > > page > > tables within xen 2.0.6? i need to find all references to a specific > > pte > > value (which is a given). essentially, a reverse page-table lookup. > > > > i''m hesitant to switch to 3.0, but if it''s easier to do what i want, > > just > > let me know. > > tools/libxc/libxc_linux_save.c has an example of pausing a domain and > then getting information about every one of its pages, including type > info. You can then filter on pagetable pages and scan them.i need to scan pagetables within the hypervisor (ie, below any domain). thanks, -A. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel