From patchwork Thu Apr 9 15:09:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46961 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 0B08A21416 for ; Thu, 9 Apr 2015 15:15:50 +0000 (UTC) Received: by wghm4 with SMTP id m4sf27292163wgh.2 for ; Thu, 09 Apr 2015 08:15: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:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=xLl4Cxf4+JZYZ3M1VodPUQAdLs4e3+RS4AC6TfXq+OA=; b=NowCtOir01aASqFyBNoD8A99AaogaN58tx2gk6lg+KTxNLzrQDqbcjcdTGrhv2tq3q oPNzvLfr3nDOE9TrLEY8YV0B6z80NySY66wZNAN9zj5FQ13rGH7pCLXCV/1iEqN1KMMq 27eqEmdlkg3PZdK7ea0zej+XiVVb8RTydU4PGsPXDuYErthO5z6MWgRvnuE3he08I8Y1 c6Q7Rw0u0mKVOmHfYsB502gJizroF+AwTXJfGlSz8uariSkLamS4TiN+UMaBGp7Gk92F AR2EujsGtsYR3ec9eDhC0+G81Mrqv/Ak5RGtf1Y/SPsXVNqBW2LHxJpwevMmJjajmLC+ Liug== X-Gm-Message-State: ALoCoQlnz8boGesjFGWKoK+yphjfDcRysRH+yIOdNBqKPEgLme+OWHVL9RUHNQSNuY8Agi+Q2wsv X-Received: by 10.194.221.65 with SMTP id qc1mr6056755wjc.7.1428592549083; Thu, 09 Apr 2015 08:15:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.240 with SMTP id jr16ls343451lab.69.gmail; Thu, 09 Apr 2015 08:15:48 -0700 (PDT) X-Received: by 10.152.43.110 with SMTP id v14mr4822976lal.4.1428592548959; Thu, 09 Apr 2015 08:15:48 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id ak2si1848585lbc.129.2015.04.09.08.15.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2015 08:15:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbcga7 with SMTP id ga7so43988738lbc.1 for ; Thu, 09 Apr 2015 08:15:48 -0700 (PDT) X-Received: by 10.112.184.70 with SMTP id es6mr28130868lbc.117.1428592548863; Thu, 09 Apr 2015 08:15: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.112.67.65 with SMTP id l1csp533681lbt; Thu, 9 Apr 2015 08:15:48 -0700 (PDT) X-Received: by 10.52.33.206 with SMTP id t14mr23829157vdi.57.1428592547314; Thu, 09 Apr 2015 08:15:47 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id to13si13262390vdb.77.2015.04.09.08.15.46 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 09 Apr 2015 08:15:47 -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 1YgE9i-0000J4-PA; Thu, 09 Apr 2015 15:14:10 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YgE9h-0000IS-6F for xen-devel@lists.xenproject.org; Thu, 09 Apr 2015 15:14:09 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 65/04-23555-04796255; Thu, 09 Apr 2015 15:14:08 +0000 X-Env-Sender: julien.grall@citrix.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1428592445!15038979!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.13.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19148 invoked from network); 9 Apr 2015 15:14:07 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 9 Apr 2015 15:14:07 -0000 X-IronPort-AV: E=Sophos;i="5.11,550,1422921600"; d="scan'208";a="253565291" From: Julien Grall To: Date: Thu, 9 Apr 2015 16:09:28 +0100 Message-ID: <1428592185-18581-3-git-send-email-julien.grall@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1428592185-18581-1-git-send-email-julien.grall@citrix.com> References: <1428592185-18581-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 v5 p2 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.217.172 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 150624a..55c8927 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);