From patchwork Wed Jun 11 16:27:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 31787 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F24D4203C2 for ; Wed, 11 Jun 2014 16:29:34 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id jt11sf19457913pbb.6 for ; Wed, 11 Jun 2014 09:29:34 -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=Dx7BqIGCmx5HNyCR6b4rrXWJaxgqDeD+zpNoIV32I3Y=; b=HkwvEB+AVGHsAGboJtncYYyAXS45+mK/Be9Dw1jrx+OoSIrQcTNDOy5Rq5/UfLCwSh SL4/WAuRAKc+NtRvHFTE9XVF3G/yjqsaDdMsF4vOAxA4Y8RmuDh5NuVaqtFnXezVK+md A+u0+7BrJ4jxPATOw36PpTS0fe7yRXQfAr87prssa5PK0ez2gjZwK5/bSCiD8KQAkG7Q bizRdDgLIaJCRdlJyekhPI9zL/uVoFoJFSwhA6RC3RVwcz3EDTN8qIr4vbmwgNkLuphD dVxT/8mXWOkyqVMDhjXHNVuQuvQGnUghqbl9F8Gf8xLmZxawZr6lFS/2xyH1tPlpv93X Ktcg== X-Gm-Message-State: ALoCoQmS3d9skhlAKczUcd07WdYs+NokqQd4Kg88FHupj2N0Fj6ejaq1mF7rW8V0AdCUDUwdIrTy X-Received: by 10.66.66.163 with SMTP id g3mr5394477pat.3.1402504174278; Wed, 11 Jun 2014 09:29:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.85 with SMTP id 79ls2705856qgk.41.gmail; Wed, 11 Jun 2014 09:29:34 -0700 (PDT) X-Received: by 10.52.120.75 with SMTP id la11mr2090141vdb.56.1402504174124; Wed, 11 Jun 2014 09:29:34 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id l8si3453264vet.80.2014.06.11.09.29.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 09:29:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jw12so8390116veb.25 for ; Wed, 11 Jun 2014 09:29:34 -0700 (PDT) X-Received: by 10.221.9.72 with SMTP id ov8mr39529699vcb.27.1402504173984; Wed, 11 Jun 2014 09:29:33 -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 vs6csp317033vcb; Wed, 11 Jun 2014 09:29:33 -0700 (PDT) X-Received: by 10.140.36.105 with SMTP id o96mr49912237qgo.25.1402504173400; Wed, 11 Jun 2014 09:29:33 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id b38si31188890qge.54.2014.06.11.09.29.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Jun 2014 09:29:33 -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 1WulNH-0007Mr-Ak; Wed, 11 Jun 2014 16:27:43 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WulNF-0007Lx-PX for xen-devel@lists.xensource.com; Wed, 11 Jun 2014 16:27:41 +0000 Received: from [193.109.254.147:56935] by server-7.bemta-14.messagelabs.com id 14/09-17726-D7388935; Wed, 11 Jun 2014 16:27:41 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1402504058!10639357!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 24568 invoked from network); 11 Jun 2014 16:27:40 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 11 Jun 2014 16:27:40 -0000 X-IronPort-AV: E=Sophos;i="5.01,459,1400025600"; d="scan'208";a="142196532" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 11 Jun 2014 16:27:37 +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; Wed, 11 Jun 2014 12:27:37 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WulN5-0004U7-W7; Wed, 11 Jun 2014 17:27:32 +0100 From: Stefano Stabellini To: Date: Wed, 11 Jun 2014 17:27:11 +0100 Message-ID: <1402504032-13267-5-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 v5 5/6] xen/arm: support irq delivery to vcpu > 0 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.128.180 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: Use vgic_get_target_vcpu to retrieve the target vcpu from do_IRQ. Remove in-code comments about missing implementation of SGI delivery to vcpus other than 0. Signed-off-by: Stefano Stabellini --- Changes in v4: - the mask in gic_route_irq_to_guest is a physical cpu mask, treat it as such; - export vgic_get_target_vcpu in a previous patch. --- xen/arch/arm/gic.c | 1 - xen/arch/arm/irq.c | 3 +-- xen/arch/arm/vgic.c | 6 ++++++ xen/include/asm-arm/gic.h | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 8ed242e..82a0be4 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -287,7 +287,6 @@ void gic_route_irq_to_guest(struct domain *d, struct irq_desc *desc, gic_set_irq_properties(desc->irq, level, cpumask_of(smp_processor_id()), GIC_PRI_IRQ); - /* TODO: do not assume delivery to vcpu0 */ p = irq_to_pending(d->vcpu[0], desc->irq); p->desc = desc; } diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index a33c797..756250c 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -175,8 +175,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq) desc->status |= IRQ_INPROGRESS; desc->arch.eoi_cpu = smp_processor_id(); - /* XXX: inject irq into all guest vcpus */ - vgic_vcpu_inject_irq(d->vcpu[0], irq); + vgic_vcpu_inject_spi(d, irq); goto out_no_end; } diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index e640de9..2192a8c 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -871,6 +871,12 @@ out: smp_send_event_check_mask(cpumask_of(v->processor)); } +void vgic_vcpu_inject_spi(struct domain *d, unsigned int irq) +{ + struct vcpu *v = vgic_get_target_vcpu(d->vcpu[0], irq); + vgic_vcpu_inject_irq(v, irq); +} + /* * Local variables: * mode: C diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index bd40628..8f09933 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -169,6 +169,7 @@ extern void domain_vgic_free(struct domain *d); extern int vcpu_vgic_init(struct vcpu *v); extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq); +extern void vgic_vcpu_inject_spi(struct domain *d, unsigned int irq); extern void vgic_clear_pending_irqs(struct vcpu *v); extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);