[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86, hvm: Add a perf counter for CR0.WP=0 emulation.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1199786279 0
# Node ID 25771a7c290703a232625892b147651f011703df
# Parent  40f9dda7c5f50795395a68d50b68f65b562732c7
x86, hvm: Add a perf counter for CR0.WP=0 emulation.
Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/mm/shadow/multi.c   |    3 +++
 xen/include/asm-x86/perfc_defn.h |    1 +
 2 files changed, 4 insertions(+)

diff -r 40f9dda7c5f5 -r 25771a7c2907 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c    Tue Jan 08 09:54:06 2008 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c    Tue Jan 08 09:57:59 2008 +0000
@@ -2899,7 +2899,10 @@ static int sh_page_fault(struct vcpu *v,
     if ( is_hvm_domain(d) 
          && unlikely(!hvm_wp_enabled(v)) 
          && regs->error_code == (PFEC_write_access|PFEC_page_present) )
+    {
+        perfc_incr(shadow_fault_emulate_wp);
         goto emulate;
+    }
 
     perfc_incr(shadow_fault_fixed);
     d->arch.paging.log_dirty.fault_count++;
diff -r 40f9dda7c5f5 -r 25771a7c2907 xen/include/asm-x86/perfc_defn.h
--- a/xen/include/asm-x86/perfc_defn.h  Tue Jan 08 09:54:06 2008 +0000
+++ b/xen/include/asm-x86/perfc_defn.h  Tue Jan 08 09:57:59 2008 +0000
@@ -56,6 +56,7 @@ PERFCOUNTER(shadow_fault_emulate_write, 
 PERFCOUNTER(shadow_fault_emulate_write, "shadow_fault emulates a write")
 PERFCOUNTER(shadow_fault_emulate_failed, "shadow_fault emulator fails")
 PERFCOUNTER(shadow_fault_emulate_stack, "shadow_fault emulate stack write")
+PERFCOUNTER(shadow_fault_emulate_wp, "shadow_fault emulate for CR0.WP=0")
 PERFCOUNTER(shadow_fault_mmio,     "shadow_fault handled as mmio")
 PERFCOUNTER(shadow_fault_fixed,    "shadow_fault fixed fault")
 PERFCOUNTER(shadow_ptwr_emulate,   "shadow causes ptwr to emulate")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.