From patchwork Wed Mar 21 16:32:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 132224 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp2356170ljb; Wed, 21 Mar 2018 09:35:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELuaisJqVZ/MZD6tcxD5rp9VvkUQqaJ+qKjoqcPaqZVFslyPIjx+WP3985g3Ovf2XLMHsHva X-Received: by 2002:a24:7a15:: with SMTP id a21-v6mr4962166itc.65.1521650105808; Wed, 21 Mar 2018 09:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521650105; cv=none; d=google.com; s=arc-20160816; b=tDII7cG6k3te1qj6WaGM9H1mDf+zO8v0POUWEd1b8sU28RyaN1o4mqglafI3aUTIPa QcYiWP3Vit44Z/MwD3PG/9P023Ayg7yEArnuM0WR513WlLoYFM7Rm8cFtCHamuWu8yMi GKgZ19q1DSt4VTBs7UyUY+pMANDQWMNVLpigeViLl1byvDyvsAbJJRglTxZz6K+kiAQf in8sYppeuCZ2bnt689cK+BLAB5DgLdlHFnHgFblFLV4nnIBh/K1JHtb8PF6i3C1ty3l1 PwrcFqKAbM0Lu+5BkqLz+zFkjlLylgv87g8RDei4xqY+3SpgF+Ghy7uvbav8YzW5xc4X ST6A== 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:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=S8i4dVo1+rB39YLx8kbPvt+oCcmiVbav1e+jmJz0sjM=; b=oAIwYcov6/kUDdNLgRv1XWq78S1axMPYmhfr89i40J1kYvOQ+JBCgXQDu0c3kND/YD OMFlMsxdbqeXOfJeYMRjFuflMVaICyKk9CGm0x4rcXqoD7pqhPzqYx7ouzRHEm4REqY4 Uf/Usv3uENA1dwe0+P66x5qVDfDetN8U6gMuizyX9dRlngo1BGjoc80C1I4mvUucmHBR /pQlDXLPiXBlNWUkqcxP2bzFGEE3xXcp3hwYVLfKTSH13cB0XfRAUXFfDzP4WcqWhASA 1+sZsPLia5SAwUq3PBMClYxNjZAggiDYWU4EKHGyRnLiWuOQjl5mU1li81mdMT88seUY nrOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Bbr3plKV; 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 f142-v6si3486594itd.11.2018.03.21.09.35.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 09:35:05 -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=Bbr3plKV; 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.89) (envelope-from ) id 1eygg2-0002wj-2A; Wed, 21 Mar 2018 16:33:26 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eygfy-0002nj-8C for xen-devel@lists.xenproject.org; Wed, 21 Mar 2018 16:33:22 +0000 X-Inumbo-ID: 88793424-2d25-11e8-9728-bc764e045a96 Received: from mail-wm0-x242.google.com (unknown [2a00:1450:400c:c09::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 88793424-2d25-11e8-9728-bc764e045a96; Wed, 21 Mar 2018 17:33:06 +0100 (CET) Received: by mail-wm0-x242.google.com with SMTP id h76so10902051wme.4 for ; Wed, 21 Mar 2018 09:33:21 -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=O71je/Q6mE0B3QDPIx0Wu7OVXMgDSVjgpSPdAon24tI=; b=Bbr3plKVfII6MVJ3m+9Cuhk2N0odtVTS+ekx5cpG5Dro5rTy7O9gPvdM98wSocS0KQ 5OGUChM2XNL6ggf8fKFn3jXtDa2QQpWiqnaqKGPVgExPXVADmxwKrxmDybCsEI6d/I1J 0YE8yilW9JC8aU8te1nt2hbeTMzx0gG4jIdFM= 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=O71je/Q6mE0B3QDPIx0Wu7OVXMgDSVjgpSPdAon24tI=; b=cabxMRhX8R1FKggm20vUNSIDAg7NNxrKUfk8ii589CCXmhIpFMmvuTT570DgOZ02N0 33zIb9D2GeHxg0zwd2z5B2OrlYQDJZobjqHYzEVVCo4e3+M4HfD5Zf5JeOV/cIVfKuYv 1ICGzYV10JhrQxsrJZ0GfXKQsPAyfHBe/gQwpn48skTXVIiZbD+5NZOW1pykvOXenu2W /KP0YFK4iXbbYgzmSWtPG/y68ad4BOicC+eSfNLPrVqDk3SnMEVzUHG+DA/ARVrsuJqh ZnPl38rJzgFhuUDewgq9sKc+0UxXZgGYNBryRAIHQm9R0MKURKdE/MAE/8HEc4cvUEr3 9TmQ== X-Gm-Message-State: AElRT7GyGzYny3izwhYmgyK4yYd1kNxRTvVR47vapRMU7hPhLEIhZQT0 bVjRTt6iNSUK/yW+yzT9zDny6g== X-Received: by 10.28.174.11 with SMTP id x11mr3210010wme.124.1521650000406; Wed, 21 Mar 2018 09:33:20 -0700 (PDT) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id n64sm4423724wmd.11.2018.03.21.09.33.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Mar 2018 09:33:19 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Wed, 21 Mar 2018 16:32:26 +0000 Message-Id: <20180321163235.12529-31-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180321163235.12529-1-andre.przywara@linaro.org> References: <20180321163235.12529-1-andre.przywara@linaro.org> Subject: [Xen-devel] [PATCH v3 30/39] ARM: new VGIC: Dump virtual IRQ info X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: xen-devel@lists.xenproject.org, Andre Przywara 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 Acked-by: Stefano Stabellini --- 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 8aaad4bffa..79c6a5553d 100644 --- a/xen/arch/arm/vgic/vgic.c +++ b/xen/arch/arm/vgic/vgic.c @@ -766,6 +766,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) {