From patchwork Mon Mar 5 16:04:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 130690 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2854362lja; Mon, 5 Mar 2018 08:07:35 -0800 (PST) X-Google-Smtp-Source: AG47ELuYdU5cKjzmb3xA8dY7BTXZHh68znj/DRlJKmUIxuNAy5mhq90JynABkkwix0T5ofUAfOIx X-Received: by 10.107.21.131 with SMTP id 125mr17157312iov.74.1520266054887; Mon, 05 Mar 2018 08:07:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520266054; cv=none; d=google.com; s=arc-20160816; b=NlwAVaNHK/HHsLG1okJ15hh5BSc2NDqedfmE8BoLlKKTgANFamnJ9XdsB6C9YPJO3M QmwAV8F3XchYoOMrJAs1ngQoGk0DJ+lSKNOZ1KS+Vlu2h+Bd3IUb8Dn/TQUdehvE4zmA ZtW+q4SHKgfxQ94loD8Yrplrc3Vd1mx/obbsFyOzNbotDiIXVa4DIgLCTY0sK2sHjYKh IMuU2t/uYXroWo5si9iTUr6m+uzIMnDvYlnLDvIufgU8mm5vsUmL55eilkqDcdml+4vm rppHaE1QVjzMeJU5Xzu+XCO/vHDGAlxhB0qbtZQ8LwMCOY+rs6/f+oX93PbytlbDBWMp YKPw== 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=0MsOxb4eUekEUYDL0bFK3qSziM05CA8HtYhfZjr0Bho=; b=b0PRKg1Vt6+ozZSY2ardJlyDRN7PnSUNuijB8ZYAEipq0pLA1S4QmgO3LPnjdsObLx RnKywfFa04DLZb2CZiM3Ps9bBlYodB+OjHTo/NTfixDOedOwKgWQoXJc7saJXCfG+IOa cWe16bFM4zi4M8bMnaSt0OiDC72sxrMGwuYDW37fpnureLMhTp7AhGoLv5Qs/5kjQdyd xnM+ppH6ognjPSpKdxnint543J5+OMw5hy8h2+SzS27lyIvbML0PA7l0+v3iec09SGXu waPMoHov21xVwLDz7rOTS5Bdm+POzpvncUOVVmuyXiCaRJMWncmHiFvm5/kFKXDW8tdt U67g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YugAoaCW; 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 f67si9049869ioj.182.2018.03.05.08.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:07:34 -0800 (PST) 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=YugAoaCW; 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 1essby-0000Sb-Fx; Mon, 05 Mar 2018 16:05:14 +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 1essbx-0000OX-Cf for xen-devel@lists.xenproject.org; Mon, 05 Mar 2018 16:05:13 +0000 X-Inumbo-ID: d4d69f14-208e-11e8-ba59-bc764e045a96 Received: from mail-wm0-x243.google.com (unknown [2a00:1450:400c:c09::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d4d69f14-208e-11e8-ba59-bc764e045a96; Mon, 05 Mar 2018 17:04:07 +0100 (CET) Received: by mail-wm0-x243.google.com with SMTP id 139so16629343wmn.2 for ; Mon, 05 Mar 2018 08:05:12 -0800 (PST) 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=MCsOm6RUrWv8G+VZbicao8d0AB8sD2qdloOdUfFit7g=; b=YugAoaCW6fs6Mv0gY1q4mu48COHMtLGVeQ35YZ7darhKkisaTEfJSPC57sCgABhe3q qM0Tnn31+6oNLvTYxvesYjIAWlwqivDqv1yqeEZnXo+SeeL9w5cEcMaD+7g6RsEto24H CErFWufpNKDFBFWLeSEIyBn2l2Y4XSQBKvi6o= 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=MCsOm6RUrWv8G+VZbicao8d0AB8sD2qdloOdUfFit7g=; b=TXKHSrNSj/eoqzdIEgJew4Aj7W5JO1L6vvIanby7Lk8UluDSw+Uos8jZZMqlj16BRe brqVVychc3Erq/j37Vmji8A5KqyeDWdYl8mFNV8dpoJ8vJ/r6+qrjL3fEYjQRPoNEs7b X7dkn/8B0NumEhPloQrTCkgcvYxt8Xzk7SIbNbW11Sha1jL6DiYbszr/F5AsoU1qNkaP iZ43mE7hrL3P48mKl7EE4/lrRPMyE8TQLoBEk1qnN7HaNTNsQ8AAvxUPqIO7gvE/2N55 0Q1OJeS4vVpNlwh+QhrEcvUSMgE3VdmQ2pawfnuimI2MuNsdTpMz3qVppfNn5935DrMV vNxg== X-Gm-Message-State: AElRT7GRXltYjnc4Q48fb0rkwWA2fO2g3JxaojwkNMFCGZ01RhY98UYm +vgqIiwzn5L6+3Ef9STXUwMaWwm0Kyg= X-Received: by 10.28.146.19 with SMTP id u19mr8435301wmd.67.1520265911605; Mon, 05 Mar 2018 08:05:11 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id y6sm6574381wmy.14.2018.03.05.08.05.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 08:05:11 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Mon, 5 Mar 2018 16:04:06 +0000 Message-Id: <20180305160415.16760-49-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180305160415.16760-1-andre.przywara@linaro.org> References: <20180305160415.16760-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 48/57] 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 RFC ... v1: - use proper locking - use one header line to announce active or pending IRQs 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 e9ef992e1e..2a2b8fd1eb 100644 --- a/xen/arch/arm/vgic/vgic.c +++ b/xen/arch/arm/vgic/vgic.c @@ -765,6 +765,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) {