WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] pte query?

To: "Aaron J. Marks" <ajmarks@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] pte query?
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <Pine.GSO.4.58.0511151008010.11025@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <Pine.GSO.4.58.0511151008010.11025@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>