From patchwork Wed Apr 2 15:01:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 27631 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC77220341 for ; Wed, 2 Apr 2014 15:04:12 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf1578327iec.10 for ; Wed, 02 Apr 2014 08:04:12 -0700 (PDT) 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=ysQKLAwPx9iPxs/GiLjh4cXwWK3u6/xDIFEVnJW1hcM=; b=m9Jc/lJnmjms3Mcv+3uuDNuHpc+qZrrVMUKxy+ozO8R2r1QKQ/v3ugbUJ2j2LRyGlD FgA8pwmw9Ko2KA/gc8VdJPAMsD/X5GXNOd2wQzhY8l6RCeze6B8wJFO3KJ87D6J+XrGc dw84+jL7X60bRQZ1F8ZslCf1/DWhpopWzFqIit7SjFwEva8JJEpN+5y0OrX3GWpir7Bt 0ipaoAWFT5fK9xBpTMxJCSmaatcr2UyFmrmeVAtFBOnMHx8T1RbwJHzIp4wfukc0zf/h gSnW+02MSIX58T8Q5ANvoss+F25mnRTn/qQxAn3O41tMrBJIwk0xu15uEHtQFcBL6TB/ VV1g== X-Gm-Message-State: ALoCoQnEmNSN6I4zdB3ImMxa0Qum5+QzusIwAcSjLgDW4HiF2RCGgHMf6gd3r/VOuFeggLZcmVnq X-Received: by 10.50.70.66 with SMTP id k2mr4546748igu.7.1396451052302; Wed, 02 Apr 2014 08:04:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.40 with SMTP id 37ls341835qgk.32.gmail; Wed, 02 Apr 2014 08:04:12 -0700 (PDT) X-Received: by 10.52.65.165 with SMTP id y5mr1004625vds.51.1396451052223; Wed, 02 Apr 2014 08:04:12 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id cb3si596772vdc.131.2014.04.02.08.04.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 08:04:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 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.173; Received: by mail-vc0-f173.google.com with SMTP id il7so480793vcb.18 for ; Wed, 02 Apr 2014 08:04:12 -0700 (PDT) X-Received: by 10.52.164.175 with SMTP id yr15mr983039vdb.59.1396451052131; Wed, 02 Apr 2014 08:04:12 -0700 (PDT) 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.12.8 with SMTP id v8csp330850vcv; Wed, 2 Apr 2014 08:04:11 -0700 (PDT) X-Received: by 10.140.49.207 with SMTP id q73mr1034279qga.103.1396451051468; Wed, 02 Apr 2014 08:04:11 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id c3si902715qan.86.2014.04.02.08.04.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 02 Apr 2014 08:04:11 -0700 (PDT) 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 1WVMg2-0004uU-JS; Wed, 02 Apr 2014 15:02:06 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVMg1-0004tj-7A for xen-devel@lists.xensource.com; Wed, 02 Apr 2014 15:02:05 +0000 Received: from [85.158.143.35:48188] by server-2.bemta-4.messagelabs.com id F2/14-06539-C662C335; Wed, 02 Apr 2014 15:02:04 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1396450920!5795894!4 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.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19321 invoked from network); 2 Apr 2014 15:02:03 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 2 Apr 2014 15:02:03 -0000 X-IronPort-AV: E=Sophos;i="4.97,780,1389744000"; d="scan'208";a="117348313" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 02 Apr 2014 15:02:00 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Wed, 2 Apr 2014 11:01:58 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WVMfp-0003fd-99; Wed, 02 Apr 2014 16:01:53 +0100 From: Stefano Stabellini To: Date: Wed, 2 Apr 2014 16:01:42 +0100 Message-ID: <1396450906-542-6-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: MIA2 Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v6 06/10] xen/arm: keep track of the GICH_LR used for the irq in struct pending_irq 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.173 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: Signed-off-by: Stefano Stabellini --- Changes in v5: - don't print p->lr in case the irq is in lr_pending, as it doesn't have an LR associate to it; - improve packing of struct pending_irq; - #define GIC_INVALID_LR and use it instead of nr_lrs. --- xen/arch/arm/gic.c | 4 +++- xen/include/asm-arm/domain.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index e0b9683..de5eadf 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -643,6 +643,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p, set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status); clear_bit(GIC_IRQ_GUEST_PENDING, &p->status); + p->lr = lr; } static inline void gic_add_to_lr_pending(struct vcpu *v, struct pending_irq *n) @@ -721,6 +722,7 @@ static void gic_clear_one_lr(struct vcpu *v, int i) if ( p->desc != NULL ) p->desc->status &= ~IRQ_INPROGRESS; clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status); + p->lr = GIC_INVALID_LR; if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) && test_bit(GIC_IRQ_GUEST_ENABLED, &p->status)) { @@ -974,7 +976,7 @@ void gic_dump_info(struct vcpu *v) list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight ) { - printk("Inflight irq=%d\n", p->irq); + printk("Inflight irq=%d lr=%u\n", p->irq, p->lr); } list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue ) diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h index bc20a15..2d94d59 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -21,7 +21,6 @@ struct vgic_irq_rank { struct pending_irq { - int irq; /* * The following two states track the lifecycle of the guest irq. * However because we are not sure and we don't want to track @@ -60,6 +59,9 @@ struct pending_irq #define GIC_IRQ_GUEST_ENABLED 2 unsigned long status; struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */ + int irq; +#define GIC_INVALID_LR ~(uint8_t)0 + uint8_t lr; uint8_t priority; /* inflight is used to append instances of pending_irq to * vgic.inflight_irqs */