From patchwork Fri Feb 14 15:51:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 24651 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 32A7F2055E for ; Fri, 14 Feb 2014 15:53:20 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id pa12sf27851077veb.9 for ; Fri, 14 Feb 2014 07:53:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=RymerdzfWCF7rLLacQsUZRfGnWnauoN4LHFaKhL6nVo=; b=A4Qi1Bj7QGtMJdHjR4i4vDBEQqOlIS/HKM1gzrsEAIgedm3NEuSct1Kxsk53x1Z/l6 Qh0qUTRbVG9C2UlAIlAMu+0xpGL/nJDtRrXVrZPQzygv5yWcvedRe7f+4QBfA2AX1v+Y A5PbezhT/FQP3BBLlHZC1VSAB7Q/5YzZjrotykHKAb1dkM3VnmFGw00vzG1uPNQuA/Et uKGluFGaBTfWcJHfx9tEfOeXFLAfLjTF1gx677A2d22XUlw4n9EXgAaVgt3OVBVJdial qHlf+rNFygmPHuRq1m1n6qiZ/H08Slw0xBvbauAgBEUY6CXwuOulJShNpIVNh/kTUffd kbfw== X-Gm-Message-State: ALoCoQnAZIEylmB7O6kmkNZpvSMSH9A2nvNYt/uGBee+8MZAZQho1OjI7j5/cojKBfeypbzCj6mG X-Received: by 10.236.18.196 with SMTP id l44mr3089862yhl.52.1392393199334; Fri, 14 Feb 2014 07:53:19 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.71 with SMTP id d65ls99377qgf.60.gmail; Fri, 14 Feb 2014 07:53:19 -0800 (PST) X-Received: by 10.52.84.102 with SMTP id x6mr1106382vdy.49.1392393199246; Fri, 14 Feb 2014 07:53:19 -0800 (PST) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id vf1si2041436vcb.92.2014.02.14.07.53.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Feb 2014 07:53:19 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ij19so9346458vcb.20 for ; Fri, 14 Feb 2014 07:53:19 -0800 (PST) X-Received: by 10.52.229.133 with SMTP id sq5mr1150928vdc.45.1392393199146; Fri, 14 Feb 2014 07:53:19 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp119324vcz; Fri, 14 Feb 2014 07:53:18 -0800 (PST) X-Received: by 10.224.79.133 with SMTP id p5mr14544319qak.56.1392393196957; Fri, 14 Feb 2014 07:53:16 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id c6si4079345qad.73.2014.02.14.07.53.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 14 Feb 2014 07:53:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WEL3T-0007s4-7u; Fri, 14 Feb 2014 15:51:55 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WEL3R-0007rV-Vf for xen-devel@lists.xensource.com; Fri, 14 Feb 2014 15:51:54 +0000 Received: from [193.109.254.147:31424] by server-5.bemta-14.messagelabs.com id 1F/33-16688-99B3EF25; Fri, 14 Feb 2014 15:51:53 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1392393110!4409914!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6793 invoked from network); 14 Feb 2014 15:51:52 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 14 Feb 2014 15:51:52 -0000 X-IronPort-AV: E=Sophos;i="4.95,845,1384300800"; d="scan'208";a="102595722" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 14 Feb 2014 15:51:47 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Fri, 14 Feb 2014 10:51:46 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WEL3E-0004ww-JL; Fri, 14 Feb 2014 15:51:40 +0000 From: Stefano Stabellini To: Date: Fri, 14 Feb 2014 15:51:38 +0000 Message-ID: <1392393098-7351-10-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH-4.5 v2 10/10] xen/arm: print more info in gic_dump_info, keep gic_lr sync'ed X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: For each inflight and pending irqs print GIC_IRQ_GUEST_ENABLED, GIC_IRQ_GUEST_PENDING and GIC_IRQ_GUEST_VISIBLE. In order to get consistent information from gic_dump_info, we need to get the vgic.lock before walking the inflight and lr_pending lists. We also need to keep v->arch.gic_lr in sync with GICH_LR registers. Signed-off-by: Stefano Stabellini --- xen/arch/arm/gic.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index b00f77c..af0994a 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -642,6 +642,7 @@ static inline void gic_set_lr(struct vcpu *v, int lr, unsigned int irq, ((p->desc->irq & GICH_LR_PHYSICAL_MASK) << GICH_LR_PHYSICAL_SHIFT); GICH[GICH_LR + lr] = lr_reg; + v->arch.gic_lr[lr] = lr_reg; set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status); clear_bit(GIC_IRQ_GUEST_PENDING, &p->status); @@ -708,11 +709,15 @@ static void _gic_clear_lr(struct vcpu *v, int i, int vgic_locked) { if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) && test_and_clear_bit(GIC_IRQ_GUEST_PENDING, &p->status) ) + { GICH[GICH_LR + i] = lr | GICH_LR_PENDING; + v->arch.gic_lr[i] = lr | GICH_LR_PENDING; + } } else if ( lr & GICH_LR_PENDING ) { clear_bit(GIC_IRQ_GUEST_PENDING, &p->status); } else { GICH[GICH_LR + i] = 0; + v->arch.gic_lr[i] = 0; clear_bit(i, &this_cpu(lr_mask)); if ( !vgic_locked ) spin_lock(&v->arch.vgic.lock); @@ -986,6 +991,8 @@ void gic_dump_info(struct vcpu *v) struct pending_irq *p; printk("GICH_LRs (vcpu %d) mask=%"PRIx64"\n", v->vcpu_id, v->arch.lr_mask); + + spin_lock(&v->arch.vgic.lock); if ( v == current ) { for ( i = 0; i < nr_lrs; i++ ) @@ -997,14 +1004,20 @@ void gic_dump_info(struct vcpu *v) list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight ) { - printk("Inflight irq=%d lr=%u\n", p->irq, p->lr); + printk("Inflight irq=%d lr=%u enable=%d pending=%d visible=%d\n", + p->irq, p->lr, test_bit(GIC_IRQ_GUEST_ENABLED, &p->status), + test_bit(GIC_IRQ_GUEST_PENDING, &p->status), + test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status)); } list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue ) { - printk("Pending irq=%d lr=%u\n", p->irq, p->lr); + printk("Pending irq=%d lr=%u enable=%d pending=%d visible=%d\n", + p->irq, p->lr, test_bit(GIC_IRQ_GUEST_ENABLED, &p->status), + test_bit(GIC_IRQ_GUEST_PENDING, &p->status), + test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status)); } - + spin_unlock(&v->arch.vgic.lock); } void __cpuinit init_maintenance_interrupt(void)