From patchwork Tue Jun 10 14:07:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 31667 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 778792054B for ; Tue, 10 Jun 2014 14:09:49 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id i17sf6675538qcy.10 for ; Tue, 10 Jun 2014 07:09:49 -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=09vbgAcC2cIQBHJQrCnmh8FPOTclDMmGJ6NyTSshIFY=; b=BUzRm70+UWfSke3aPzrkrKUAiOT0Y6CKR3aTjnKiaLB7k75qrq8zHeE4Ur8UPqrozd rppI2u0s0jqkW2U0COYYwoo4zNkBGGlU65ZKbzYpa/LCA01vUbCHcnZiNZUx5QQu10A7 BsVPJDKjO7V9JEuDY65EuRG+jNZYH/l+mL/W2O8BLs/3p7L9zAG/w0rZo0ceM08OwiT4 ffx60FW6f0KXdYi+chwqZX3D39syBlnVA/T5eq04T2H1SXjzHbddaieQWNcGdtik6nD6 6gwSU6+eb5uuVOGKjgVPxALja61mpymzcLVb8nHPqMmbEnlTM36kYQTqpNuz0TkwYE2t /37g== X-Gm-Message-State: ALoCoQkJ6t6zPc+GEfovU3GkaJX0HDaXSjF28OtybGIfnoV45ojfHvkEm5bR+7SxXYJiV8BvEVG4 X-Received: by 10.236.75.66 with SMTP id y42mr633609yhd.20.1402409389263; Tue, 10 Jun 2014 07:09:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.166 with SMTP id z35ls2202463qgz.93.gmail; Tue, 10 Jun 2014 07:09:49 -0700 (PDT) X-Received: by 10.220.253.132 with SMTP id na4mr30761557vcb.39.1402409389057; Tue, 10 Jun 2014 07:09:49 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id c2si11862289vcn.74.2014.06.10.07.09.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 07:09:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id ij19so2405816vcb.22 for ; Tue, 10 Jun 2014 07:09:49 -0700 (PDT) X-Received: by 10.221.7.71 with SMTP id on7mr32534266vcb.18.1402409388966; Tue, 10 Jun 2014 07:09:48 -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.221.54.6 with SMTP id vs6csp228342vcb; Tue, 10 Jun 2014 07:09:48 -0700 (PDT) X-Received: by 10.140.82.180 with SMTP id h49mr40524567qgd.84.1402409388357; Tue, 10 Jun 2014 07:09:48 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id z6si27704749qas.82.2014.06.10.07.09.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 07:09:48 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) 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 1WuMiQ-0000OZ-M4; Tue, 10 Jun 2014 14:07:54 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WuMiP-0000NR-3g for xen-devel@lists.xensource.com; Tue, 10 Jun 2014 14:07:53 +0000 Received: from [85.158.139.211:21812] by server-1.bemta-5.messagelabs.com id B5/74-01663-83117935; Tue, 10 Jun 2014 14:07:52 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1402409267!9152999!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11293 invoked from network); 10 Jun 2014 14:07:51 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 10 Jun 2014 14:07:51 -0000 X-IronPort-AV: E=Sophos; i="4.98,1009,1392163200"; d="scan'208"; a="141612267" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 10 Jun 2014 14:07:46 +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.3.181.6; Tue, 10 Jun 2014 10:07:44 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WuMiA-0006am-R6; Tue, 10 Jun 2014 15:07:38 +0100 From: Stefano Stabellini To: Date: Tue, 10 Jun 2014 15:07:14 +0100 Message-ID: <1402409240-28114-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 v9 06/12] 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) 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: Move the irq field in pending_irq to improve packing. Signed-off-by: Stefano Stabellini Acked-by: Ian Campbell Acked-by: Julien Grall --- 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 99b6bb4..97cd1bf 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -560,6 +560,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) @@ -635,6 +636,7 @@ static void gic_update_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)) gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority); @@ -847,7 +849,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 aabeb51..e5db9e3 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 */