[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] pte query?


  • To: "Aaron J. Marks" <ajmarks@xxxxxxxxxxxxxx>
  • From: Jacob Gorm Hansen <jacobg@xxxxxxx>
  • Date: Tue, 15 Nov 2005 17:06:26 +0100
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 15 Nov 2005 16:06:29 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EAQxnFnrdXve6YSq/ojZreWrBS4Hgp5rGJv5+EQs4eSWqBItwjRB1TSy3CeS8/Qq1jo04NeLe8wDTBXumEbYZKa39JQztOPY+IIdBXAs0HuT/5uBQl8JHiSu8P7oe2D/GLsyploSQgs+HsEWcqcUJiMbewOgQ84o9Lyp9sfVSBk=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

On 11/15/05, Aaron J. Marks <ajmarks@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.