p2m: Small audit fixes.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 5 Jan 2009 10:47:51 +0000 (10:47 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 5 Jan 2009 10:47:51 +0000 (10:47 +0000)
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/arch/x86/mm/p2m.c

index b5868c76459ec61a591b063fd6a66ae0ae77f9d0..5f0db181f36f32c7f7eb09c7abf45912a377cc36 100644 (file)
@@ -1653,6 +1653,8 @@ static void audit_p2m(struct domain *d)
     if ( test_linear )
         flush_tlb_local();
 
+    spin_lock(&d->page_alloc_lock);
+
     /* Audit part one: walk the domain's page allocation list, checking
      * the m2p entries. */
     for ( entry = d->page_list.next;
@@ -1720,6 +1722,8 @@ static void audit_p2m(struct domain *d)
         //                mfn, gfn, p2mfn, lp2mfn);
     }
 
+    spin_unlock(&d->page_alloc_lock);
+
     /* Audit part two: walk the domain's p2m table, checking the entries. */
     if ( pagetable_get_pfn(d->arch.phys_table) != 0 )
     {
@@ -1779,7 +1783,7 @@ static void audit_p2m(struct domain *d)
                         for ( i1 = 0; i1 < L1_PAGETABLE_ENTRIES; i1++)
                         {
                             m2pfn = get_gpfn_from_mfn(mfn+i1);
-                            if ( m2pfn != (gfn + i) )
+                            if ( m2pfn != (gfn + i1) )
                             {
                                 pmbad++;
                                 P2M_PRINTK("mismatch: gfn %#lx -> mfn %#lx"