[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 3/3] x86/perfc: fold HVM's VM-exit counter arrays
Only one of them can be in use at a time, so make the whole set union- like. While doing the rename in SVM code, combine the two perf_incra(), generalizing the range upwards of VMEXIT_NPF. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- v2: New. --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -2644,7 +2644,10 @@ void svm_vmexit_handler(struct cpu_user_ goto out; } - perfc_incra(svmexits, exit_reason); + perfc_incra(vmexits, + exit_reason < VMEXIT_NPF + ? exit_reason + : exit_reason - VMEXIT_NPF + VMEXIT_NPF_PERFC); hvm_maybe_deassert_evtchn_irq(); @@ -2973,7 +2976,6 @@ void svm_vmexit_handler(struct cpu_user_ break; case VMEXIT_NPF: - perfc_incra(svmexits, VMEXIT_NPF_PERFC); if ( cpu_has_svm_decode ) v->arch.hvm.svm.cached_insn_len = vmcb->guest_ins_len & 0xf; rc = vmcb->exitinfo1 & PFEC_page_present --- a/xen/arch/x86/include/asm/perfc_defn.h +++ b/xen/arch/x86/include/asm/perfc_defn.h @@ -7,13 +7,13 @@ PERFCOUNTER_ARRAY(exceptions, #ifdef CONFIG_HVM #define VMX_PERF_EXIT_REASON_SIZE 65 -#define VMX_PERF_VECTOR_SIZE 0x20 -PERFCOUNTER_ARRAY(vmexits, "vmexits", VMX_PERF_EXIT_REASON_SIZE) -PERFCOUNTER_ARRAY(cause_vector, "cause vector", VMX_PERF_VECTOR_SIZE) - #define VMEXIT_NPF_PERFC 143 #define SVM_PERF_EXIT_REASON_SIZE (VMEXIT_NPF_PERFC + 1) -PERFCOUNTER_ARRAY(svmexits, "SVMexits", SVM_PERF_EXIT_REASON_SIZE) +PERFCOUNTER_ARRAY(vmexits, "vmexits", + MAX(VMX_PERF_EXIT_REASON_SIZE, SVM_PERF_EXIT_REASON_SIZE)) + +#define VMX_PERF_VECTOR_SIZE 0x20 +PERFCOUNTER_ARRAY(cause_vector, "cause vector", VMX_PERF_VECTOR_SIZE) #endif /* CONFIG_HVM */
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |