From patchwork Fri Apr 21 02:22:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 753076 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w8KKv5PJvz9s2x for ; Fri, 21 Apr 2017 12:23:47 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w8KKv4PmFzDqMG for ; Fri, 21 Apr 2017 12:23:47 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w8KKb26kYzDqKs for ; Fri, 21 Apr 2017 12:23:31 +1000 (AEST) Received: from pasglop.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v3L2N1LO005173; Thu, 20 Apr 2017 21:23:05 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Fri, 21 Apr 2017 12:22:59 +1000 Message-Id: <20170421022259.13485-3-benh@kernel.crashing.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170421022259.13485-1-benh@kernel.crashing.org> References: <20170421022259.13485-1-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 3/3] xive: Log more information in opal_xive_dump() for emulation state X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Add a counter of total interrupts taken by a CPU, dump the queue buffer both before and after the current pointer, and also display the HW state of the queue descriptor and the PQ state of the IPI. Signed-off-by: Benjamin Herrenschmidt --- hw/xive.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/hw/xive.c b/hw/xive.c index c44f7d8..b40c5ca 100644 --- a/hw/xive.c +++ b/hw/xive.c @@ -300,6 +300,7 @@ struct xive_cpu_state { uint32_t eqmsk; uint8_t eqgen; void *eqmmio; + uint64_t total_irqs; }; #ifdef XIVE_PERCPU_LOG @@ -3186,6 +3187,7 @@ static uint32_t xive_read_eq(struct xive_cpu_state *xs, bool just_peek) xs->eqptr = (xs->eqptr + 1) & xs->eqmsk; if (xs->eqptr == 0) xs->eqgen ^= 1; + xs->total_irqs++; } return cur & 0x00ffffff; } @@ -4439,6 +4441,9 @@ static int64_t opal_xive_dump_emu(uint32_t pir) { struct cpu_thread *c = find_cpu_by_pir(pir); struct xive_cpu_state *xs; + struct xive_eq *eq; + uint32_t ipi_target = -1u; + uint8_t *mm, pq; if (!c) return OPAL_PARAMETER; @@ -4453,13 +4458,31 @@ static int64_t opal_xive_dump_emu(uint32_t pir) lock(&xs->lock); prlog(PR_INFO, "CPU[%04x]: cppr=%02x mfrr=%02x pend=%02x" - " prev_cppr=%02x\n", pir, - xs->cppr, xs->mfrr, xs->pending, xs->prev_cppr); + " prev_cppr=%02x total_irqs=%llx\n", pir, + xs->cppr, xs->mfrr, xs->pending, xs->prev_cppr, xs->total_irqs); - prlog(PR_INFO, "CPU[%04x]: EQ IDX=%x MSK=%x G=%d [%08x %08x ...]\n", + prlog(PR_INFO, "CPU[%04x]: EQ IDX=%x MSK=%x G=%d [%08x %08x %08x > %08x %08x %08x %08x ...]\n", pir, xs->eqptr, xs->eqmsk, xs->eqgen, + xs->eqbuf[(xs->eqptr - 3) & xs->eqmsk], + xs->eqbuf[(xs->eqptr - 2) & xs->eqmsk], + xs->eqbuf[(xs->eqptr - 1) & xs->eqmsk], xs->eqbuf[(xs->eqptr + 0) & xs->eqmsk], - xs->eqbuf[(xs->eqptr + 1) & xs->eqmsk]); + xs->eqbuf[(xs->eqptr + 1) & xs->eqmsk], + xs->eqbuf[(xs->eqptr + 2) & xs->eqmsk], + xs->eqbuf[(xs->eqptr + 3) & xs->eqmsk]); + + mm = xs->xive->esb_mmio + GIRQ_TO_IDX(xs->ipi_irq) * 0x20000; + pq = in_8(mm + 0x10800); + xive_get_irq_targetting(xs->ipi_irq, &ipi_target, NULL, NULL); + prlog(PR_INFO, "CPU[%04x]: IPI #%08x PQ=%x target=%08x\n", + pir, xs->ipi_irq, pq, ipi_target); + + __xive_cache_scrub(xs->xive, xive_cache_eqc, xs->eq_blk, + xs->eq_idx + XIVE_EMULATION_PRIO, + false, false); + eq = xive_get_eq(xs->xive, xs->eq_idx + XIVE_EMULATION_PRIO); + prlog(PR_INFO, "CPU[%04x]: EQ @%p W0=%08x W1=%08x qbuf @%p\n", + pir, eq, eq->w0, eq->w1, xs->eqbuf); log_print(xs);