From patchwork Tue Jun 24 18:11:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 32443 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BEE54201EF for ; Tue, 24 Jun 2014 18:14:29 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id ma3sf2393278pbc.7 for ; Tue, 24 Jun 2014 11:14: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=h5Kh+nY87AEig1KR6KNOb7K+gqjPddKHHMBilYqnBtE=; b=VmwNT1V3o1Qyla/vNDTo5g1K4g15CJwUaeOAvSogqtk67SiGLrpT/6oJZAxGENqIJt bEas45PlJNlNBlrvyAig5wOVKrquNHCLKJnjF9JbUzenUTtcM9i8dDHwEM5oDYW28E+X 54lxC9ED0bL+LmnuRlw2GfCjYY+zic7rPDRuf7bpCB+a4pi3bRZA+mYt7QGYqSa4O8fb nEk+by7+4a+PLgcw/flDxQdlnNAIZGvnjhoMRGn3yuwKVgRbngJZmuZLqAPNDoWWKse/ uYL73+OUB2xIz7anrdFPYmwbjE8cI66fPfp6XCt1rXFcJdLkCEyaue6esp7fc3P/M21a 24ow== X-Gm-Message-State: ALoCoQnF0gacMyPyem4wwTZOcOD5l5z7w/6T5cywW7fl5oqF/e3h2YAJM0cfb2Jw82pYsCRRAFQC X-Received: by 10.66.65.202 with SMTP id z10mr1202934pas.45.1403633668942; Tue, 24 Jun 2014 11:14:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.201 with SMTP id h67ls2502487qgd.2.gmail; Tue, 24 Jun 2014 11:14:28 -0700 (PDT) X-Received: by 10.52.241.76 with SMTP id wg12mr1776917vdc.5.1403633668791; Tue, 24 Jun 2014 11:14:28 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id fs13si706335vdb.23.2014.06.24.11.14.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Jun 2014 11:14:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jx11so766209veb.33 for ; Tue, 24 Jun 2014 11:14:28 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr1839671vdc.8.1403633668652; Tue, 24 Jun 2014 11:14: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 tc5csp230883vcb; Tue, 24 Jun 2014 11:14:28 -0700 (PDT) X-Received: by 10.224.137.135 with SMTP id w7mr4540099qat.52.1403633668242; Tue, 24 Jun 2014 11:14:28 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id y10si1393326qax.44.2014.06.24.11.14.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Jun 2014 11:14:28 -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 1WzVCu-0001CT-Bs; Tue, 24 Jun 2014 18:12:36 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WzVCt-0001C3-DW for xen-devel@lists.xensource.com; Tue, 24 Jun 2014 18:12:35 +0000 Received: from [85.158.137.68:18521] by server-17.bemta-3.messagelabs.com id 6F/16-05521-29FB9A35; Tue, 24 Jun 2014 18:12:34 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1403633552!12115426!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 25609 invoked from network); 24 Jun 2014 18:12:33 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 24 Jun 2014 18:12:33 -0000 X-IronPort-AV: E=Sophos;i="5.01,539,1400025600"; d="scan'208";a="146911336" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 24 Jun 2014 18:12:32 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Tue, 24 Jun 2014 14:12:31 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WzVCk-0005rp-AT; Tue, 24 Jun 2014 19:12:26 +0100 From: Stefano Stabellini To: Date: Tue, 24 Jun 2014 19:11:53 +0100 Message-ID: <1403633514-8853-1-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: MIA1 Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH 1/2] xen/arm: remove workaround to inject evtchn_irq on irq enable 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.174 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: evtchn_upcall_pending is already set by common code at vcpu creation, therefore on ARM we also need to call vgic_vcpu_inject_irq for it. Currently we do that from vgic_enable_irqs as a workaround. Do this properly by calling vgic_vcpu_inject_irq in the appropriate places at vcpu creation time, making sure to call it after the vcpu is up (_VPF_down has been cleared). Signed-off-by: Stefano Stabellini --- xen/arch/arm/domain.c | 4 +++- xen/arch/arm/domain_build.c | 2 ++ xen/arch/arm/vgic.c | 18 ++++-------------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index e20ba0b..c29b063 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -651,8 +651,10 @@ int arch_set_info_guest( v->is_initialised = 1; if ( ctxt->flags & VGCF_online ) + { clear_bit(_VPF_down, &v->pause_flags); - else + vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq); + } else set_bit(_VPF_down, &v->pause_flags); return 0; diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 9d9cba9..f7cf80d 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1134,6 +1134,8 @@ int construct_dom0(struct domain *d) } #endif + vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq); + for ( i = 1, cpu = 0; i < d->max_vcpus; i++ ) { cpu = cpumask_cycle(cpu, &cpu_online_map); diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 7f1e263..1806b72 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -504,20 +504,10 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n) v_target = _vgic_get_target_vcpu(v, irq); p = irq_to_pending(v_target, irq); set_bit(GIC_IRQ_GUEST_ENABLED, &p->status); - /* We need to force the first injection of evtchn_irq because - * evtchn_upcall_pending is already set by common code on vcpu - * creation. */ - if ( irq == v_target->domain->arch.evtchn_irq && - vcpu_info(current, evtchn_upcall_pending) && - list_empty(&p->inflight) ) - vgic_vcpu_inject_irq(v_target, irq); - else { - unsigned long flags; - spin_lock_irqsave(&v_target->arch.vgic.lock, flags); - if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) ) - gic_raise_guest_irq(v_target, irq, p->priority); - spin_unlock_irqrestore(&v_target->arch.vgic.lock, flags); - } + spin_lock_irqsave(&v_target->arch.vgic.lock, flags); + if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) ) + gic_raise_guest_irq(v_target, irq, p->priority); + spin_unlock_irqrestore(&v_target->arch.vgic.lock, flags); if ( p->desc != NULL ) { irq_set_affinity(p->desc, cpumask_of(v_target->processor));