From patchwork Wed Mar 19 12:31:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 26572 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 904E820534 for ; Wed, 19 Mar 2014 12:33:54 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf22531389yha.3 for ; Wed, 19 Mar 2014 05:33:54 -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=5YEfvDcT0Sw0SsPKU9TnGw9LBZn1SBXxsM/COzoyYaI=; b=SqBJ9Jrc77aByfQkH3UPsFpY9jhGkmOp8d91yA048G4pjPPA8txuaz0MeTnSwWE8hC auMKBfKjMPkRf2GsKJ9Suh5SoW993eDPhxNdmnJm1vuNaA2DxtILol3VECke2pZNnoxx Za42PQBfFUUNSeSefX3qd5Mh1yow41YCgSNjieXdHfwVUQKTcKIh0+n7sv+iRsQHNmfv 1c/AyzkAGcsM4OfMP3VrMOalY8F/CJQLU132A1Be/PBq42djEGgr6nIJBqOv08qlV2R9 jgZt0yeTHSJ0i1+ffwvJU7S+84lzYWyXpemw00YdMnYK/savf8SJ4v6RRtUx3N2D/IgC tleQ== X-Gm-Message-State: ALoCoQlX2rWHsojCXrp6sI8t2o7WcioF0fi2e55CSQsGrqCMHViqQ8PLA2xBTV5MLoQucKXGiefH X-Received: by 10.224.124.5 with SMTP id s5mr14488441qar.1.1395232434272; Wed, 19 Mar 2014 05:33:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.233 with SMTP id r96ls2659683qgd.98.gmail; Wed, 19 Mar 2014 05:33:54 -0700 (PDT) X-Received: by 10.58.212.200 with SMTP id nm8mr29688978vec.11.1395232434123; Wed, 19 Mar 2014 05:33:54 -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 vd8si3466006vdc.178.2014.03.19.05.33.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 05:33:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id im17so9242758vcb.9 for ; Wed, 19 Mar 2014 05:33:54 -0700 (PDT) X-Received: by 10.221.74.65 with SMTP id yv1mr221004vcb.31.1395232434038; Wed, 19 Mar 2014 05:33:54 -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.220.78.9 with SMTP id i9csp295218vck; Wed, 19 Mar 2014 05:33:53 -0700 (PDT) X-Received: by 10.52.3.129 with SMTP id c1mr506404vdc.37.1395232433330; Wed, 19 Mar 2014 05:33:53 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id f7si7636157vcz.57.2014.03.19.05.33.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Mar 2014 05:33:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) 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 1WQFfk-0007Pf-LM; Wed, 19 Mar 2014 12:32:40 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQFfi-0007Ol-VQ for xen-devel@lists.xensource.com; Wed, 19 Mar 2014 12:32:39 +0000 Received: from [85.158.143.35:58793] by server-3.bemta-4.messagelabs.com id 10/BD-13602-66E89235; Wed, 19 Mar 2014 12:32:38 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1395232356!3212920!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.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18874 invoked from network); 19 Mar 2014 12:32:37 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 19 Mar 2014 12:32:37 -0000 X-IronPort-AV: E=Sophos;i="4.97,685,1389744000"; d="scan'208";a="112829415" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 19 Mar 2014 12:32:36 +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.2.342.4; Wed, 19 Mar 2014 08:32:35 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WQFfa-0005Tm-Gn; Wed, 19 Mar 2014 12:32:30 +0000 From: Stefano Stabellini To: Date: Wed, 19 Mar 2014 12:31:56 +0000 Message-ID: <1395232325-19226-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: MIA2 Cc: julien.grall@citrix.com, jtd@galois.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v4 01/10] xen/arm: no need to set HCR_VI when using the vgic to inject irqs 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=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: HCR_VI forces the guest to resume execution in IRQ mode and can actually cause spurious interrupt injections. The GIC is capable of injecting interrupts into the guest and causing it to switch to IRQ mode automatically, without any need for the hypervisor to set HCR_VI manually. Signed-off-by: Stefano Stabellini Acked-by: Julien Grall Acked-by: Ian Campbell --- Changes in v4: - improve commit message. --- xen/arch/arm/gic.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 91a2982..b388ef3 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -726,22 +726,6 @@ void gic_clear_pending_irqs(struct vcpu *v) spin_unlock_irqrestore(&gic.lock, flags); } -static void gic_inject_irq_start(void) -{ - register_t hcr = READ_SYSREG(HCR_EL2); - WRITE_SYSREG(hcr | HCR_VI, HCR_EL2); - isb(); -} - -static void gic_inject_irq_stop(void) -{ - register_t hcr = READ_SYSREG(HCR_EL2); - if (hcr & HCR_VI) { - WRITE_SYSREG(hcr & ~HCR_VI, HCR_EL2); - isb(); - } -} - int gic_events_need_delivery(void) { return (!list_empty(¤t->arch.vgic.lr_pending) || @@ -754,10 +738,6 @@ void gic_inject(void) vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq, 1); gic_restore_pending_irqs(current); - if (!gic_events_need_delivery()) - gic_inject_irq_stop(); - else - gic_inject_irq_start(); } int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,