From patchwork Tue Aug 5 11:26:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 34947 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7757D2397D for ; Tue, 5 Aug 2014 11:29:33 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf4915052pdb.9 for ; Tue, 05 Aug 2014 04:29: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:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=M6kUhpqHTiyRArlE28VyoJNDdkAdK0Ypd3yymelUsPg=; b=Ng+FDkhZ4SDRbgAsqxr7yaPG63bfrvS+bATZ4ukxz5+BlM4dKSPxlP5AXuCJf/Kxav qvPB546l3nG8FZI2J8NLRtiYS5skMqt+NOjC+W8ZFTMbxIeWtoxBjSipdt1cq5kcDWVb Sj3K/E0fpIon2fbcckXUwvbdtjEgkQLpyK+hX5kNUdKLJ+VJyV+Lny39Xv1pZKovyQkI SjxN4xGom4e4ywdqNouMHtbSNFQ2Cr3FDO0zL16JmMRgKKyQDE+M9EldCqqzlVwm8Lfr HDAUEovCgi4NNXZmYnh6y06OJV+FvowHSaYUZeuTTbQDppQxc4Gkl0657Zfc9bDVUlH/ UDyA== X-Gm-Message-State: ALoCoQm9xUvt5W105vCvSa/zWUHp9EQX4+krAweMahtuQzmeleLMogQ6PO1Vg4olYPATQ91P/2w8 X-Received: by 10.70.98.164 with SMTP id ej4mr1672370pdb.3.1407238170820; Tue, 05 Aug 2014 04:29:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.233 with SMTP id j96ls196029qgd.80.gmail; Tue, 05 Aug 2014 04:29:30 -0700 (PDT) X-Received: by 10.220.68.208 with SMTP id w16mr134511vci.79.1407238170684; Tue, 05 Aug 2014 04:29:30 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id tb18si828986vdb.72.2014.08.05.04.29.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 04:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so1178488vcb.37 for ; Tue, 05 Aug 2014 04:29:30 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr1228866vcb.48.1407238170615; Tue, 05 Aug 2014 04:29:30 -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 tc5csp379343vcb; Tue, 5 Aug 2014 04:29:30 -0700 (PDT) X-Received: by 10.50.39.8 with SMTP id l8mr5854857igk.13.1407238169928; Tue, 05 Aug 2014 04:29:29 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id mk1si4228704igb.10.2014.08.05.04.29.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 05 Aug 2014 04:29:29 -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 1XEcuE-0004XB-K4; Tue, 05 Aug 2014 11:27:50 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XEcuE-0004Wu-14 for xen-devel@lists.xensource.com; Tue, 05 Aug 2014 11:27:50 +0000 Received: from [85.158.139.211:18337] by server-17.bemta-5.messagelabs.com id B8/6E-08943-5BFB0E35; Tue, 05 Aug 2014 11:27:49 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1407238067!11940500!1 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 15017 invoked from network); 5 Aug 2014 11:27:48 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 5 Aug 2014 11:27:48 -0000 X-IronPort-AV: E=Sophos;i="5.01,804,1400025600"; d="scan'208";a="159461794" 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; Tue, 5 Aug 2014 07:27:46 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XEcu5-0002cW-EI; Tue, 05 Aug 2014 12:27:41 +0100 From: Stefano Stabellini To: Date: Tue, 5 Aug 2014 12:26:21 +0100 Message-ID: <1407237989-27654-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 v10 02/10] 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.220.178 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 ebfec83..9947e8c 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -321,13 +321,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) ) { @@ -335,10 +328,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, DABT_WORD)], 0, irq & 0x3); n->irq = irq; - set_bit(GIC_IRQ_GUEST_QUEUED, &n->status); n->priority = priority; /* the irq is enabled */