From patchwork Tue Apr 28 14:32:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 47674 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DFD6421550 for ; Tue, 28 Apr 2015 14:35:32 +0000 (UTC) Received: by wgin8 with SMTP id n8sf33978246wgi.0 for ; Tue, 28 Apr 2015 07:35:32 -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:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=L5xp6IaBFsi80CfONXaA5N1stOdFYmijZ8gCbtrdHNU=; b=S9upDozRz9siTkOaiyHVGOJK0Y70bF5+CNgVBftADvFzlOj0lX4Hm4WIu0wYFjA3mj QxXUaq2CW/yl2GVU5OAQ8/4j0W246nFMNrrAKJO/Ot7EdrfneELm7HXPOIWRdo4snVgH 6cCqB4rflkegM30CFgky2k4RbINXKCDUb6VdaG1PTeRviwB4zurbLv82OPOHrfOXXVyh DMN+zfJkc3+KkKfftJ40FFByEiO9KJabXvbhaZ+ii/wIP85+UYrpa8o2tR7b8EZIsnm3 Xd/J9h/DwBfH2eY3RgO7YmfD7ucZekZ0GubSpUpGm39ryER3lnD0STJBf8Z3OqAG8z9u V3kg== X-Gm-Message-State: ALoCoQnckwi+ta9UVzGfVtm0AItxq3nNFD6cTlQ1ge5hgNj3Duw2hUEf3D0+rE1QjxqRS54W8dvX X-Received: by 10.194.5.229 with SMTP id v5mr4312104wjv.0.1430231732223; Tue, 28 Apr 2015 07:35:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.74 with SMTP id j10ls86010lag.7.gmail; Tue, 28 Apr 2015 07:35:32 -0700 (PDT) X-Received: by 10.152.204.40 with SMTP id kv8mr14618127lac.113.1430231729909; Tue, 28 Apr 2015 07:35:29 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id f1si17182259laa.117.2015.04.28.07.35.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2015 07:35:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lagv1 with SMTP id v1so105991166lag.3 for ; Tue, 28 Apr 2015 07:35:29 -0700 (PDT) X-Received: by 10.152.27.1 with SMTP id p1mr14551098lag.112.1430231729814; Tue, 28 Apr 2015 07:35:29 -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.112.67.65 with SMTP id l1csp1924428lbt; Tue, 28 Apr 2015 07:35:29 -0700 (PDT) X-Received: by 10.140.218.18 with SMTP id o18mr12652093qhb.30.1430231728442; Tue, 28 Apr 2015 07:35:28 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id jf5si18676610qcb.8.2015.04.28.07.35.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 28 Apr 2015 07:35:28 -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 1Yn6Zl-0007kZ-5Q; Tue, 28 Apr 2015 14:33:29 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yn6Zj-0007kE-Q3 for xen-devel@lists.xenproject.org; Tue, 28 Apr 2015 14:33:27 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id F5/EB-30545-63A9F355; Tue, 28 Apr 2015 14:33:26 +0000 X-Env-Sender: julien.grall@citrix.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1430231604!8366589!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.13.14; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21228 invoked from network); 28 Apr 2015 14:33:26 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 28 Apr 2015 14:33:26 -0000 X-IronPort-AV: E=Sophos;i="5.11,663,1422921600"; d="scan'208";a="257345539" From: Julien Grall To: Date: Tue, 28 Apr 2015 15:32:26 +0100 Message-ID: <1430231563-25648-3-git-send-email-julien.grall@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1430231563-25648-1-git-send-email-julien.grall@citrix.com> References: <1430231563-25648-1-git-send-email-julien.grall@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v6 02/19] xen/arm: vgic: Add spi_to_pending 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: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 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: From: Julien Grall Introduce spi_to_pending in order retrieve the irq_pending structure for a specific SPI. It's not possible to re-use irq_to_pending because it's required a VCPU and some call of the new function may during domain destruction after the VCPUs are freed. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v5: - Add Ian's Ack Changes in v4: - Patch added --- xen/arch/arm/vgic.c | 7 +++++++ xen/include/asm-arm/vgic.h | 1 + 2 files changed, 8 insertions(+) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 0d30e2c..c1fa4bb 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -371,6 +371,13 @@ struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq) return n; } +struct pending_irq *spi_to_pending(struct domain *d, unsigned int irq) +{ + ASSERT(irq >= NR_LOCAL_IRQS); + + return &d->arch.vgic.pending_irqs[irq - 32]; +} + void vgic_clear_pending_irqs(struct vcpu *v) { struct pending_irq *p, *t; diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h index 647f2fe..8d22532 100644 --- a/xen/include/asm-arm/vgic.h +++ b/xen/include/asm-arm/vgic.h @@ -185,6 +185,7 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq); extern void vgic_vcpu_inject_spi(struct domain *d, unsigned int virq); extern void vgic_clear_pending_irqs(struct vcpu *v); extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq); +extern struct pending_irq *spi_to_pending(struct domain *d, unsigned int irq); extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, int s); extern struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq); extern int vgic_emulate(struct cpu_user_regs *regs, union hsr hsr);