aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-01-05 19:36:56 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 02:55:27 -0500
commit37a7d8b046da6254718be1409140cd7bf3126f8f (patch)
treea52e3a60234920301c881b8b534e85ae1bed5cf8 /drivers/kvm/paging_tmpl.h
parent9ede74e0af549d75d4ea870bed8b178983816745 (diff)
[PATCH] KVM: MMU: add audit code to check mappings, etc are correct
Signed-off-by: Avi Kivity <avi@qumranet.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/paging_tmpl.h')
-rw-r--r--drivers/kvm/paging_tmpl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 32b385188454..c894b51ba3f8 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -355,6 +355,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
355 int r; 355 int r;
356 356
357 pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code); 357 pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code);
358 kvm_mmu_audit(vcpu, "pre page fault");
358 359
359 r = mmu_topup_memory_caches(vcpu); 360 r = mmu_topup_memory_caches(vcpu);
360 if (r) 361 if (r)
@@ -402,6 +403,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
402 pgprintk("%s: io work, no access\n", __FUNCTION__); 403 pgprintk("%s: io work, no access\n", __FUNCTION__);
403 inject_page_fault(vcpu, addr, 404 inject_page_fault(vcpu, addr,
404 error_code | PFERR_PRESENT_MASK); 405 error_code | PFERR_PRESENT_MASK);
406 kvm_mmu_audit(vcpu, "post page fault (io)");
405 return 0; 407 return 0;
406 } 408 }
407 409
@@ -410,10 +412,12 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
410 */ 412 */
411 if (pte_present && !fixed && !write_pt) { 413 if (pte_present && !fixed && !write_pt) {
412 inject_page_fault(vcpu, addr, error_code); 414 inject_page_fault(vcpu, addr, error_code);
415 kvm_mmu_audit(vcpu, "post page fault (guest)");
413 return 0; 416 return 0;
414 } 417 }
415 418
416 ++kvm_stat.pf_fixed; 419 ++kvm_stat.pf_fixed;
420 kvm_mmu_audit(vcpu, "post page fault (fixed)");
417 421
418 return write_pt; 422 return write_pt;
419} 423}