From patchwork Thu Mar 19 19:29:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46088 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 09F9421515 for ; Thu, 19 Mar 2015 19:31:59 +0000 (UTC) Received: by widex7 with SMTP id ex7sf14616559wid.2 for ; Thu, 19 Mar 2015 12:31:58 -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:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=3/TgJDZa3RIBYI+GU1nUvj0PjnspY04c4nozw5i60nw=; b=SkKVIdQTDU5LL299nmgi0emP62n3IrcQXvtBCL3h4Pdx0QoTwwOIlNCkzUlNfxsI2E arlNJGP2wH+8qd83IfnNfmnF3gDWPxZE/gvNlUrDWQWbirYJWTyyO7pTkeDV2xaMWrbU ZBwpY3/rydj54PDWZ65gLdJY9RJSMJGfZ0xnPnZLwknXVchGJbMGujgNy/n18jTt/VJR dwZQF9fJ71eu5IJfjvfbmZ0NF1ne/31Fm896sMgSYyGt8VmS36UgWuCIiNUPYquXSHvf skEhhC/B+tk3JOdPIPYqWCaUgapibtihhJZK+eVf0PecPkIl8i/JCEfbYgNiJU+eSTm2 O/BQ== X-Gm-Message-State: ALoCoQnQgGdQfeo2UvyRsa3wBAsgMKb7+O/mTy1ZBlWyP47BLBNiunLTbQTBRSrnuA81zdJA7Eh9 X-Received: by 10.112.40.81 with SMTP id v17mr8391979lbk.5.1426793518344; Thu, 19 Mar 2015 12:31:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.180.75 with SMTP id dm11ls345739lac.70.gmail; Thu, 19 Mar 2015 12:31:58 -0700 (PDT) X-Received: by 10.152.37.69 with SMTP id w5mr70318081laj.15.1426793518069; Thu, 19 Mar 2015 12:31:58 -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 mi2si1605471lbc.167.2015.03.19.12.31.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 12:31:57 -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 lbbsy1 with SMTP id sy1so60454299lbb.1 for ; Thu, 19 Mar 2015 12:31:57 -0700 (PDT) X-Received: by 10.152.29.68 with SMTP id i4mr20560256lah.19.1426793517645; Thu, 19 Mar 2015 12:31:57 -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.35.133 with SMTP id h5csp597317lbj; Thu, 19 Mar 2015 12:31:56 -0700 (PDT) X-Received: by 10.52.240.33 with SMTP id vx1mr52042521vdc.3.1426793516245; Thu, 19 Mar 2015 12:31:56 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ak1si1943260vdc.87.2015.03.19.12.31.55 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 12:31:56 -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 1YYg9q-0004hS-RT; Thu, 19 Mar 2015 19:31:06 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYg9p-0004e3-BF for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 19:31:05 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id AB/48-18861-8F32B055; Thu, 19 Mar 2015 19:31:04 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-5.tower-206.messagelabs.com!1426793463!11948863!1 X-Originating-IP: [209.85.212.173] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12541 invoked from network); 19 Mar 2015 19:31:04 -0000 Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com) (209.85.212.173) by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 19 Mar 2015 19:31:04 -0000 Received: by wibg7 with SMTP id g7so126878965wib.1 for ; Thu, 19 Mar 2015 12:31:03 -0700 (PDT) X-Received: by 10.194.156.133 with SMTP id we5mr158299399wjb.37.1426793463789; Thu, 19 Mar 2015 12:31:03 -0700 (PDT) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id hl8sm3203005wjb.38.2015.03.19.12.31.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 12:31:02 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 19 Mar 2015 19:29:43 +0000 Message-Id: <1426793399-6283-18-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v4 17/33] 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: , MIME-Version: 1.0 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: julien.grall@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: 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 --- 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 74751e0..fc283ec 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);