From patchwork Thu Mar 15 20:30:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 131854 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp1579351ljb; Thu, 15 Mar 2018 13:33:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELtRtVejxZdJV5+0ejV4shgUrFiE2MKkX+HTxoj5ALVyoOsPngJV38rUAp4ONEGWs6UI+qQq X-Received: by 2002:a24:a70c:: with SMTP id a12-v6mr7537074itf.56.1521146006341; Thu, 15 Mar 2018 13:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521146006; cv=none; d=google.com; s=arc-20160816; b=GVpGILhbEo56nr1JmmBw4h1yNJit0S5jsdPo4dFHx4jMzgW4TQeosSsMSx8ruIBBDL U+Qb25i4LPMZGOhIRjn+DvutFEWm/xQ+6sFKr0pOwTdL0OOz+Y5ZoyPpJHZBwJZIqwVH 7xwZ5oxhaX3/ww8EAceRKvC+flZUnfYcgYfLmWGPKXW/Q2WO4pP3gLeMEOnHqBzqG0+b KiE2s9q31xaCJiWItowfyJw9FX6+m2rC/Wih9tGFOARdWP5YHA3pzLW5BZialRqBBxNj pLBOvZLp7WuxD7lnKQsZ1gO9Tb6u1w9G09XwVX4on/SGS3zdpe28uhVlxBtRqqL1qiLA 4hWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=MJHSCmZwo4u0vNDBfvWScmYLMj65Dq8KYIu9XXU7GZM=; b=bKvD+BB5ZL4NuC/P8ywrV5zmf73Tgr9mCho6WlWdHvtWwNgNt05GkN1fRdy4mde0MA zCdInFHyMLVUBW7TjATNC070UNj257lJkUOBxa83pbOx5oAGC7t3aCs6r1bqIg/wIFKC HllPbJAGs8XP3r+SGsMCVAd5cMrd9Aosx/m+hmMPpTULDxBWuKLe3/WZ7aGBp/A5DcxY QXbezS0NMZgt+J3eQamHjOza0I1aHJi3AEWabt0xXUxoSW7hRuV1vs9NEPjHemFymRYd aUjd9XRaX1sjF+Ca9ds1DbrQEFN6O/pPk91gRt/ADDFNi7CDD/VhsLuEhfeAh2MVZlHa KYaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YrJVh9Rm; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 96si444113ior.272.2018.03.15.13.33.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 13:33:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YrJVh9Rm; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewZXR-0004OB-KX; Thu, 15 Mar 2018 20:31:49 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewZXQ-0004Ks-Q7 for xen-devel@lists.xenproject.org; Thu, 15 Mar 2018 20:31:48 +0000 X-Inumbo-ID: de487e25-288f-11e8-9728-bc764e045a96 Received: from mail-wr0-x241.google.com (unknown [2a00:1450:400c:c0c::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id de487e25-288f-11e8-9728-bc764e045a96; Thu, 15 Mar 2018 21:31:41 +0100 (CET) Received: by mail-wr0-x241.google.com with SMTP id v65so9565193wrc.11 for ; Thu, 15 Mar 2018 13:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Uas9V8J4hO0fVvLluEj/4O0qtXNkl3bKnACeA+0J14c=; b=YrJVh9RmKUwFrJ4JwK6I4tLc+C9i8p6Sjmh+9VjN0Qe2x0UjcjcpcOnmQZlRudqUUh /+MrrEKDgiAYhQDlfl6mtRQV0XZX8p5AyIHgerCkLvj9JW2ATKSGvRXs4Pn+kKEM+klD e8D65PqjqzGEVrFCLZ+eSeAuS36s4gGY9VVNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Uas9V8J4hO0fVvLluEj/4O0qtXNkl3bKnACeA+0J14c=; b=b5qrSO9myqvV1c4cS80fogB+qyAHIN2+62urDfYw3amH5J+SU0gyTWdq5X5KiHuN2h fjkNcb6MH937WwJ4Acs+Evs4xu7pkSv/2oj1aTs3d1hsorujNaIdCYewZHYdRgAXl3nt Tt+s90om600uhFRg6he3evlwmiCMsrsZpXRE6CsmW0nHqQRrnxcOc3lDue+IqWN+0hvJ YY9/F5UP9QxWG/ErntoEhjWXFTaZ/PI64+vrVh/wCRRGS9ph4u07cbOxfBS8/iII92sU U4mJkr+7UAsh/6JeT8KkrScbixo0xudRoVGpRjbKC8K+PdIJU9Ju/FNBo94Kgpw//sCB VUwQ== X-Gm-Message-State: AElRT7HVe+Q5kmW9kDIXBWLeD0wUCyVZ5Q8n2UC58cvY+BUBYlG4QiDw oKGqzaMyH6pywrPT7fKdZSM1VHxNS74= X-Received: by 10.223.150.175 with SMTP id u44mr3921714wrb.104.1521145906029; Thu, 15 Mar 2018 13:31:46 -0700 (PDT) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id w125sm3217102wmw.20.2018.03.15.13.31.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Mar 2018 13:31:45 -0700 (PDT) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Thu, 15 Mar 2018 20:30:41 +0000 Message-Id: <20180315203050.19791-37-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180315203050.19791-1-andre.przywara@linaro.org> References: <20180315203050.19791-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH v2 36/45] ARM: new VGIC: Dump virtual IRQ info X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When we dump guest state on the Xen console, we also print the state of IRQs that are on a VCPU. Add the code to dump the state of an IRQ handled by the new VGIC. Signed-off-by: Andre Przywara Acked-by: Julien Grall --- Changelog v1 ... v2: - Add Acked-by: xen/arch/arm/vgic/vgic.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/xen/arch/arm/vgic/vgic.c b/xen/arch/arm/vgic/vgic.c index d7ef6e32fc..b56682f8e4 100644 --- a/xen/arch/arm/vgic/vgic.c +++ b/xen/arch/arm/vgic/vgic.c @@ -756,6 +756,31 @@ void vgic_free_virq(struct domain *d, unsigned int virq) clear_bit(virq, d->arch.vgic.allocated_irqs); } +void gic_dump_vgic_info(struct vcpu *v) +{ + struct vgic_cpu *vgic_cpu = &v->arch.vgic; + struct vgic_irq *irq; + unsigned long flags; + + spin_lock_irqsave(&v->arch.vgic.ap_list_lock, flags); + + if ( !list_empty(&vgic_cpu->ap_list_head) ) + printk(" active or pending interrupts queued:\n"); + + list_for_each_entry ( irq, &vgic_cpu->ap_list_head, ap_list ) + { + spin_lock(&irq->irq_lock); + printk(" %s %s irq %u: %spending, %sactive, %senabled\n", + irq->hw ? "hardware" : "virtual", + irq->config == VGIC_CONFIG_LEVEL ? "level" : "edge", + irq->intid, irq_is_pending(irq) ? "" : "not ", + irq->active ? "" : "not ", irq->enabled ? "" : "not "); + spin_unlock(&irq->irq_lock); + } + + spin_unlock_irqrestore(&v->arch.vgic.ap_list_lock, flags); +} + struct irq_desc *vgic_get_hw_irq_desc(struct domain *d, struct vcpu *v, unsigned int virq) {