From: Suresh Warrier Subject: [PATCH 10/14] KVM: PPC: Book3S HV: Dump irqmap in debugfs Date: Fri, 26 Feb 2016 12:40:28 -0600 Message-ID: <1456512032-31286-11-git-send-email-warrier@linux.vnet.ibm.com> References: <1456512032-31286-1-git-send-email-warrier@linux.vnet.ibm.com> Cc: warrier@linux.vnet.ibm.com, paulus@samba.org, agraf@suse.de, mpe@ellerman.id.au To: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org Return-path: Received: from e37.co.us.ibm.com ([32.97.110.158]:58614 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933676AbcBZSls (ORCPT ); Fri, 26 Feb 2016 13:41:48 -0500 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 Feb 2016 11:41:47 -0700 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 856FC19D8051 for ; Fri, 26 Feb 2016 11:29:42 -0700 (MST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1QIfjV034996226 for ; Fri, 26 Feb 2016 11:41:45 -0700 Received: from d03av05.boulder.ibm.com (localhost [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1QIffgH019538 for ; Fri, 26 Feb 2016 11:41:45 -0700 In-Reply-To: <1456512032-31286-1-git-send-email-warrier@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Dump the passthrough irqmap structure associated with a guest as part of /sys/kernel/debug/powerpc/kvm-xics-*. Signed-off-by: Suresh Warrier --- arch/powerpc/kvm/book3s_xics.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index b90570c..855d669 100644 --- a/arch/powerpc/kvm/book3s_xics.c +++ b/arch/powerpc/kvm/book3s_xics.c @@ -905,6 +905,21 @@ EXPORT_SYMBOL_GPL(kvmppc_xics_hcall); /* -- Initialisation code etc. -- */ +static void xics_debugfs_irqmap(struct seq_file *m, + struct kvmppc_passthru_irqmap *pimap) +{ + int i; + + if (!pimap) + return; + seq_printf(m, "========\nPIRQMAP Cache: %d maps\n===========\n", + pimap->n_cached); + for (i = 0; i < pimap->n_cached; i++) { + seq_printf(m, "r_hwirq=%x, v_hwirq=%x\n", + pimap->cached[i].r_hwirq, pimap->cached[i].v_hwirq); + } +} + static int xics_debug_show(struct seq_file *m, void *private) { struct kvmppc_xics *xics = m->private; @@ -926,6 +941,8 @@ static int xics_debug_show(struct seq_file *m, void *private) t_check_resend = 0; t_reject = 0; + xics_debugfs_irqmap(m, kvm->arch.pimap); + seq_printf(m, "=========\nICP state\n=========\n"); kvm_for_each_vcpu(i, vcpu, kvm) { -- 1.8.3.4