From fcb1a7ac2f408905a48638190b619f59d8ab9cee Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 5 Jan 2009 10:47:51 +0000 Subject: [PATCH] p2m: Small audit fixes. Signed-off-by: George Dunlap --- xen/arch/x86/mm/p2m.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index b5868c7645..5f0db181f3 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -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" -- 2.30.2