diff -r a76b4e00e186 xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Tue Dec 16 13:14:25 2008 +0000 +++ b/xen/arch/x86/mm/p2m.c Wed Dec 17 12:59:25 2008 +0000 @@ -693,6 +693,8 @@ 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; @@ -760,6 +762,8 @@ // 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 ) { @@ -815,7 +819,7 @@ 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"