From patchwork Thu Jul 3 16:53:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 33060 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF71020560 for ; Thu, 3 Jul 2014 16:56:28 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id uy5sf2282683obc.5 for ; Thu, 03 Jul 2014 09:56:28 -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=iUnhfkNQMEMLZIjpVaG2oJ6XyWPg/56uwk306rXOkFk=; b=gUt73GbxgESCxND2Otagsnc6epuz+GxlklJrzYHUTJ2SKb52liHjCS+M9wtWEOg597 9oe7Z1J+JD1Z9fVvj1sFJBFdNf1Mdn2DTJecGqMj5xFuoaeSvyG856qn/6NTFRXe0cnc JSN4A07/efYmCACtM/IPTnjP4NnSFbbkZPtYJifkh4zwXavcqz0dt0ydRKRwc3rXYWQf PnUmv2NTvYCROcDJMh9smSN1UXS1kJr2vtfuPv551n9rEsgDyeoBetilo8o33FEZAmgA bJ5ftB+tlJpwrFQ+OsRA6ome0zVTq95TC2MZjLwvpN+VU5ANDQg0XrZnZlDy3nKd91Dg gaMA== X-Gm-Message-State: ALoCoQk0RncJoGqvsg0R3J8B6PiPrLH+etDEKOBhEmZ6c19e8Vak5Yc9RsvEmo8v6YFx4UqAkr5v X-Received: by 10.42.49.138 with SMTP id w10mr5044890icf.13.1404406588367; Thu, 03 Jul 2014 09:56:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.203 with SMTP id v69ls558403qgd.6.gmail; Thu, 03 Jul 2014 09:56:28 -0700 (PDT) X-Received: by 10.52.178.201 with SMTP id da9mr1301829vdc.47.1404406588259; Thu, 03 Jul 2014 09:56:28 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id fl10si1124554vec.42.2014.07.03.09.56.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Jul 2014 09:56:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id db11so529064veb.18 for ; Thu, 03 Jul 2014 09:56:28 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr4924131vcb.2.1404406588179; Thu, 03 Jul 2014 09:56:28 -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.37.5 with SMTP id tc5csp392546vcb; Thu, 3 Jul 2014 09:56:27 -0700 (PDT) X-Received: by 10.50.124.4 with SMTP id me4mr57471706igb.39.1404406587617; Thu, 03 Jul 2014 09:56:27 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 19si25886817igk.48.2014.07.03.09.56.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 03 Jul 2014 09:56:27 -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 1X2kGr-0004ax-Ft; Thu, 03 Jul 2014 16:54:05 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X2kGp-0004aR-1D for xen-devel@lists.xensource.com; Thu, 03 Jul 2014 16:54:04 +0000 Received: from [85.158.139.211:42749] by server-14.bemta-5.messagelabs.com id 25/1F-27057-AAA85B35; Thu, 03 Jul 2014 16:54:02 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1404406440!13526197!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26741 invoked from network); 3 Jul 2014 16:54:01 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 3 Jul 2014 16:54:01 -0000 X-IronPort-AV: E=Sophos;i="5.01,595,1400025600"; d="scan'208";a="149633504" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 03 Jul 2014 16:54:00 +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; Thu, 3 Jul 2014 12:53:59 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1X2kGg-00014w-85; Thu, 03 Jul 2014 17:53:54 +0100 From: Stefano Stabellini To: Date: Thu, 3 Jul 2014 17:53:09 +0100 Message-ID: <1404406394-18231-2-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 v7 2/6] xen/arm: move setting GIC_IRQ_GUEST_QUEUED earlier 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.173 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: It makes the code cleaner, especially with the following patches. Signed-off-by: Stefano Stabellini Acked-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/vgic.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 0c8673f..e928879 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -750,13 +750,6 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq) spin_lock_irqsave(&v->arch.vgic.lock, flags); - if ( !list_empty(&n->inflight) ) - { - set_bit(GIC_IRQ_GUEST_QUEUED, &n->status); - gic_raise_inflight_irq(v, irq); - goto out; - } - /* vcpu offline */ if ( test_bit(_VPF_down, &v->pause_flags) ) { @@ -764,10 +757,17 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq) return; } + set_bit(GIC_IRQ_GUEST_QUEUED, &n->status); + + if ( !list_empty(&n->inflight) ) + { + gic_raise_inflight_irq(v, irq); + goto out; + } + priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8, irq)], 0, irq & 0x3); n->irq = irq; - set_bit(GIC_IRQ_GUEST_QUEUED, &n->status); n->priority = priority; /* the irq is enabled */