From: Juergen Gross Date: Tue, 14 Dec 2021 08:49:23 +0000 (+0100) Subject: x86/perfc: add hypercall performance counters for hvm, correct pv X-Git-Tag: archive/raspbian/4.17.0-1+rpi1^2~33^2~1227 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=668dd44902bbaf52f8e7214e0da060b6ec962e88;p=xen.git x86/perfc: add hypercall performance counters for hvm, correct pv The HVM hypercall handler is missing incrementing the per hypercall counters. Add that. The counters for PV are handled wrong, as they are not using perf_incra() with the number of the hypercall as index, but are incrementing the first hypercall entry (set_trap_table) for each hypercall. Fix that. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c index 1f04ffb272..c4e5c34c37 100644 --- a/xen/arch/x86/hvm/hypercall.c +++ b/xen/arch/x86/hvm/hypercall.c @@ -325,6 +325,8 @@ int hvm_hypercall(struct cpu_user_regs *regs) ioreq_signal_mapcache_invalidate(); } + perfc_incra(hypercalls, eax); + return curr->hcall_preempted ? HVM_HCALL_preempted : HVM_HCALL_completed; } diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c index 16a77e3a35..ecdd58deea 100644 --- a/xen/arch/x86/pv/hypercall.c +++ b/xen/arch/x86/pv/hypercall.c @@ -238,7 +238,7 @@ _pv_hypercall(struct cpu_user_regs *regs, bool compat) if ( curr->hcall_preempted ) regs->rip -= 2; - perfc_incr(hypercalls); + perfc_incra(hypercalls, eax); } enum mc_disposition pv_do_multicall_call(struct mc_state *state)