aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-01-08 09:57:59 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-01-08 09:57:59 +0000
commitc741a6246754635ac808b74ee5b0bd51bdfccaa8 (patch)
tree1902e612c9ce4edaec60535a6a3dda75db1dae85
parentecd285a056ef7557ca2ba507728e1b8e2d6ef0b2 (diff)
downloadxen-c741a6246754635ac808b74ee5b0bd51bdfccaa8.tar.gz
xen-c741a6246754635ac808b74ee5b0bd51bdfccaa8.tar.bz2
xen-c741a6246754635ac808b74ee5b0bd51bdfccaa8.zip
x86, hvm: Add a perf counter for CR0.WP=0 emulation.
Signed-off-by Kevin Tian <kevin.tian@intel.com>
-rw-r--r--xen/arch/x86/mm/shadow/multi.c3
-rw-r--r--xen/include/asm-x86/perfc_defn.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4777e54080..1c4e7fad70 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -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 --git a/xen/include/asm-x86/perfc_defn.h b/xen/include/asm-x86/perfc_defn.h
index eb18b5fe38..460c1f2b58 100644
--- a/xen/include/asm-x86/perfc_defn.h
+++ b/xen/include/asm-x86/perfc_defn.h
@@ -56,6 +56,7 @@ PERFCOUNTER(shadow_fault_emulate_read, "shadow_fault emulates a read")
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")