diff options
author | Suresh Warrier <warrier@linux.vnet.ibm.com> | 2016-08-19 15:35:57 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2016-09-12 10:12:34 +1000 |
commit | 65e7026a6c90484fbaa076d2c51e61baf7241960 (patch) | |
tree | cdb34af09dcdda56a6db37f2efbc4f6645c62fe3 /arch/powerpc/kvm/book3s_hv_rm_xics.c | |
parent | 5d375199ea963fa2a972eae9c7d83db36ed37082 (diff) |
KVM: PPC: Book3S HV: Counters for passthrough IRQ stats
Add VCPU stat counters to track affinity for passthrough
interrupts.
pthru_all: Counts all passthrough interrupts whose IRQ mappings are
in the kvmppc_passthru_irq_map structure.
pthru_host: Counts all cached passthrough interrupts that were injected
from the host through kvm_set_irq (i.e. not handled in
real mode).
pthru_bad_aff: Counts how many cached passthrough interrupts have
bad affinity (receiving CPU is not running VCPU that is
the target of the virtual interrupt in the guest).
Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_rm_xics.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_rm_xics.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c index 5f7527ec4ad5..82ff5de8b1e7 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_xics.c +++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c @@ -716,11 +716,19 @@ int kvmppc_rm_h_eoi(struct kvm_vcpu *vcpu, unsigned long xirr) icp->rm_eoied_irq = irq; } - if (state->host_irq && state->intr_cpu != -1) { - int pcpu = cpu_first_thread_sibling(raw_smp_processor_id()); - if (state->intr_cpu != pcpu) - xics_opal_rm_set_server(state->host_irq, pcpu); - state->intr_cpu = -1; + if (state->host_irq) { + ++vcpu->stat.pthru_all; + if (state->intr_cpu != -1) { + int pcpu = raw_smp_processor_id(); + + pcpu = cpu_first_thread_sibling(pcpu); + ++vcpu->stat.pthru_host; + if (state->intr_cpu != pcpu) { + ++vcpu->stat.pthru_bad_aff; + xics_opal_rm_set_server(state->host_irq, pcpu); + } + state->intr_cpu = -1; + } } bail: return check_too_hard(xics, icp); |