view xen/include/asm-x86/perfc_defn.h @ 19942:c1541cc7e985

vmx: Add support for Pause-Loop Exiting

New NHM processors will support Pause-Loop Exiting by adding 2
VM-execution control fields:
PLE_Gap - upper bound on the amount of time between two successive
executions of PAUSE in a loop.
PLE_Window - upper bound on the amount of time a guest is allowed to
execute in a PAUSE loop

If the time, between this execution of PAUSE and previous one, exceeds
the PLE_Gap, processor consider this PAUSE belongs to a new loop.
Otherwise, processor determins the the total execution time of this
loop(since 1st PAUSE in this loop), and triggers a VM exit if total
time exceeds the PLE_Window.
* Refer SDM volume 3b section 21.6.13 & 22.1.3.

Pause-Loop Exiting can be used to detect Lock-Holder Preemption, where
one VP is sched-out after hold a spinlock, then other VPs for same
lock are sched-in to waste the CPU time.

Our tests indicate that most spinlocks are held for less than 2^12
cycles. Performance tests show that with 2X LP over-commitment we can
get +2% perf improvement for kernel build(Even more perf gain with
more LPs).

Signed-off-by: Zhai Edwin <>
author Keir Fraser <>
date Tue Jul 07 14:06:35 2009 +0100 (2009-07-07)
parents fb3e1e84d8f4
line source
1 /* This file is legitimately included multiple times. */
2 /*#ifndef __XEN_PERFC_DEFN_H__*/
3 /*#define __XEN_PERFC_DEFN_H__*/
5 PERFCOUNTER_ARRAY(exceptions, "exceptions", 32)
8 #define VMX_PERF_VECTOR_SIZE 0x20
10 PERFCOUNTER_ARRAY(cause_vector, "cause vector", VMX_PERF_VECTOR_SIZE)
12 #define VMEXIT_NPF_PERFC 141
13 #define SVM_PERF_EXIT_REASON_SIZE (1+141)
16 PERFCOUNTER(seg_fixups, "segmentation fixups")
18 PERFCOUNTER(apic_timer, "apic timer interrupts")
20 PERFCOUNTER(domain_page_tlb_flush, "domain page tlb flushes")
22 PERFCOUNTER(calls_to_mmuext_op, "calls to mmuext_op")
23 PERFCOUNTER(num_mmuext_ops, "mmuext ops")
24 PERFCOUNTER(calls_to_mmu_update, "calls to mmu_update")
25 PERFCOUNTER(num_page_updates, "page updates")
26 PERFCOUNTER(writable_mmu_updates, "mmu_updates of writable pages")
27 PERFCOUNTER(calls_to_update_va, "calls to update_va_map")
28 PERFCOUNTER(page_faults, "page faults")
29 PERFCOUNTER(copy_user_faults, "copy_user faults")
31 PERFCOUNTER(map_domain_page_count, "map_domain_page count")
32 PERFCOUNTER(ptwr_emulations, "writable pt emulations")
34 PERFCOUNTER(exception_fixed, "pre-exception fixed")
36 PERFCOUNTER(guest_walk, "guest pagetable walks")
38 /* Shadow counters */
39 PERFCOUNTER(shadow_alloc, "calls to shadow_alloc")
40 PERFCOUNTER(shadow_alloc_tlbflush, "shadow_alloc flushed TLBs")
42 /* STATUS counters do not reset when 'P' is hit */
43 PERFSTATUS(shadow_alloc_count, "number of shadow pages in use")
44 PERFCOUNTER(shadow_free, "calls to shadow_free")
45 PERFCOUNTER(shadow_prealloc_1, "shadow recycles old shadows")
46 PERFCOUNTER(shadow_prealloc_2, "shadow recycles in-use shadows")
47 PERFCOUNTER(shadow_linear_map_failed, "shadow hit read-only linear map")
48 PERFCOUNTER(shadow_a_update, "shadow A bit update")
49 PERFCOUNTER(shadow_ad_update, "shadow A&D bit update")
50 PERFCOUNTER(shadow_fault, "calls to shadow_fault")
51 PERFCOUNTER(shadow_fault_fast_gnp, "shadow_fault fast path n/p")
52 PERFCOUNTER(shadow_fault_fast_mmio, "shadow_fault fast path mmio")
53 PERFCOUNTER(shadow_fault_fast_fail, "shadow_fault fast path error")
54 PERFCOUNTER(shadow_fault_bail_bad_gfn, "shadow_fault guest bad gfn")
55 PERFCOUNTER(shadow_fault_bail_real_fault,
56 "shadow_fault really guest fault")
57 PERFCOUNTER(shadow_fault_emulate_read, "shadow_fault emulates a read")
58 PERFCOUNTER(shadow_fault_emulate_write, "shadow_fault emulates a write")
59 PERFCOUNTER(shadow_fault_emulate_failed, "shadow_fault emulator fails")
60 PERFCOUNTER(shadow_fault_emulate_stack, "shadow_fault emulate stack write")
61 PERFCOUNTER(shadow_fault_emulate_wp, "shadow_fault emulate for CR0.WP=0")
62 PERFCOUNTER(shadow_fault_fast_emulate, "shadow_fault fast emulate")
63 PERFCOUNTER(shadow_fault_fast_emulate_fail,
64 "shadow_fault fast emulate failed")
65 PERFCOUNTER(shadow_fault_mmio, "shadow_fault handled as mmio")
66 PERFCOUNTER(shadow_fault_fixed, "shadow_fault fixed fault")
67 PERFCOUNTER(shadow_ptwr_emulate, "shadow causes ptwr to emulate")
68 PERFCOUNTER(shadow_validate_gl1e_calls, "calls to shadow_validate_gl1e")
69 PERFCOUNTER(shadow_validate_gl2e_calls, "calls to shadow_validate_gl2e")
70 PERFCOUNTER(shadow_validate_gl3e_calls, "calls to shadow_validate_gl3e")
71 PERFCOUNTER(shadow_validate_gl4e_calls, "calls to shadow_validate_gl4e")
72 PERFCOUNTER(shadow_hash_lookups, "calls to shadow_hash_lookup")
73 PERFCOUNTER(shadow_hash_lookup_head, "shadow hash hit in bucket head")
74 PERFCOUNTER(shadow_hash_lookup_miss, "shadow hash misses")
75 PERFCOUNTER(shadow_get_shadow_status, "calls to get_shadow_status")
76 PERFCOUNTER(shadow_hash_inserts, "calls to shadow_hash_insert")
77 PERFCOUNTER(shadow_hash_deletes, "calls to shadow_hash_delete")
78 PERFCOUNTER(shadow_writeable, "shadow removes write access")
79 PERFCOUNTER(shadow_writeable_h_1, "shadow writeable: 32b w2k3")
80 PERFCOUNTER(shadow_writeable_h_2, "shadow writeable: 32pae w2k3")
81 PERFCOUNTER(shadow_writeable_h_3, "shadow writeable: 64b w2k3")
82 PERFCOUNTER(shadow_writeable_h_4, "shadow writeable: linux low/solaris")
83 PERFCOUNTER(shadow_writeable_h_5, "shadow writeable: linux high")
84 PERFCOUNTER(shadow_writeable_h_6, "shadow writeable: FreeBSD")
85 PERFCOUNTER(shadow_writeable_h_7, "shadow writeable: sl1p")
86 PERFCOUNTER(shadow_writeable_h_8, "shadow writeable: sl1p failed")
87 PERFCOUNTER(shadow_writeable_bf, "shadow writeable brute-force")
88 PERFCOUNTER(shadow_writeable_bf_1, "shadow writeable resync bf")
89 PERFCOUNTER(shadow_mappings, "shadow removes all mappings")
90 PERFCOUNTER(shadow_mappings_bf, "shadow rm-mappings brute-force")
91 PERFCOUNTER(shadow_early_unshadow, "shadow unshadows for fork/exit")
92 PERFCOUNTER(shadow_unshadow, "shadow unshadows a page")
93 PERFCOUNTER(shadow_up_pointer, "shadow unshadow by up-pointer")
94 PERFCOUNTER(shadow_unshadow_bf, "shadow unshadow brute-force")
95 PERFCOUNTER(shadow_get_page_fail, "shadow_get_page_from_l1e failed")
96 PERFCOUNTER(shadow_check_gwalk, "shadow checks gwalk")
97 PERFCOUNTER(shadow_inconsistent_gwalk, "shadow check inconsistent gwalk")
98 PERFCOUNTER(shadow_rm_write_flush_tlb,
99 "shadow flush tlb by removing write perm")
101 PERFCOUNTER(shadow_invlpg, "shadow emulates invlpg")
102 PERFCOUNTER(shadow_invlpg_fault, "shadow invlpg faults")
104 PERFCOUNTER(shadow_em_ex_pt, "shadow extra pt write")
105 PERFCOUNTER(shadow_em_ex_non_pt, "shadow extra non-pt-write op")
106 PERFCOUNTER(shadow_em_ex_fail, "shadow extra emulation failed")
108 PERFCOUNTER(shadow_oos_fixup_add, "shadow OOS fixup adds")
109 PERFCOUNTER(shadow_oos_fixup_evict,"shadow OOS fixup evictions")
110 PERFCOUNTER(shadow_unsync, "shadow OOS unsyncs")
111 PERFCOUNTER(shadow_unsync_evict, "shadow OOS evictions")
112 PERFCOUNTER(shadow_resync, "shadow OOS resyncs")
114 PERFCOUNTER(mshv_call_sw_addr_space, "MS Hv Switch Address Space")
115 PERFCOUNTER(mshv_call_flush_tlb_list, "MS Hv Flush TLB list")
116 PERFCOUNTER(mshv_call_flush_tlb_all, "MS Hv Flush TLB all")
117 PERFCOUNTER(mshv_call_long_wait, "MS Hv Notify long wait")
118 PERFCOUNTER(mshv_rdmsr_osid, "MS Hv rdmsr Guest OS ID")
119 PERFCOUNTER(mshv_rdmsr_hc_page, "MS Hv rdmsr hypercall page")
120 PERFCOUNTER(mshv_rdmsr_vp_index, "MS Hv rdmsr vp index")
121 PERFCOUNTER(mshv_rdmsr_icr, "MS Hv rdmsr icr")
122 PERFCOUNTER(mshv_rdmsr_tpr, "MS Hv rdmsr tpr")
123 PERFCOUNTER(mshv_wrmsr_osid, "MS Hv wrmsr Guest OS ID")
124 PERFCOUNTER(mshv_wrmsr_hc_page, "MS Hv wrmsr hypercall page")
125 PERFCOUNTER(mshv_wrmsr_vp_index, "MS Hv wrmsr vp index")
126 PERFCOUNTER(mshv_wrmsr_icr, "MS Hv wrmsr icr")
127 PERFCOUNTER(mshv_wrmsr_tpr, "MS Hv wrmsr tpr")
128 PERFCOUNTER(mshv_wrmsr_eoi, "MS Hv wrmsr eoi")
130 PERFCOUNTER(realmode_emulations, "realmode instructions emulated")
131 PERFCOUNTER(realmode_exits, "vmexits from realmode")
133 PERFCOUNTER(pauseloop_exits, "vmexits from Pause-Loop Detection")
135 /*#endif*/ /* __XEN_PERFC_DEFN_H__ */