From patchwork Tue Jun 10 14:07: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: 31669 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DC99E2054B for ; Tue, 10 Jun 2014 14:09:53 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id il7sf617773vcb.0 for ; Tue, 10 Jun 2014 07:09:53 -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=+fj1efffQSLId3Ljdp3Kuq5kS5WLgUVk5+Pe/WYW8Mc=; b=R05gC6H0NvC7XcRbpWG99RNvHShvEk4VIVDTy8XD26epWmu49MUfVOOQDTnXOdKnC/ VxDxQa2XzoX6bx/RSMckJ4zyLhRWafXNZVwwr1L6lXsLvFvuuhBjlHQ0DAKTZ91ZRBbE vhY8jMhyQ9EK3p62K21fLWS7JnOR87Hs+fHJnJdWJqIdPZlwFlRs+ROlHDEHTHV4HppD 9s5yJ1nhlcvKViPBYJlZn5l63CgkFfoeUzeKS8vbzixgd3mkRW4GjKz77WwGBvrdViIY 4xl4d4VGYpjNUVirEM8oRo0qOK5igXa3Sgty7McNejsbRncwsKdOgxdG99F4F4//+hTn l6dQ== X-Gm-Message-State: ALoCoQnxpTcgAdzdU1cETnweRz9YHc+TU/S8+HSUCPNlC8ZSYXq4arLFKLslS7F1B4ZLf4a+VkcW X-Received: by 10.236.35.5 with SMTP id t5mr9546821yha.9.1402409393719; Tue, 10 Jun 2014 07:09:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.145 with SMTP id 17ls2149875qgn.21.gmail; Tue, 10 Jun 2014 07:09:53 -0700 (PDT) X-Received: by 10.58.216.163 with SMTP id or3mr321805vec.80.1402409393527; Tue, 10 Jun 2014 07:09:53 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id f5si874452vee.90.2014.06.10.07.09.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 07:09:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id il7so270923vcb.40 for ; Tue, 10 Jun 2014 07:09:53 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr33037985vcb.0.1402409393424; Tue, 10 Jun 2014 07:09:53 -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 vs6csp228352vcb; Tue, 10 Jun 2014 07:09:53 -0700 (PDT) X-Received: by 10.220.69.4 with SMTP id x4mr597030vci.74.1402409392624; Tue, 10 Jun 2014 07:09:52 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id xe6si11871763vcb.28.2014.06.10.07.09.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 07:09:52 -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 1WuMiO-0000NV-Tq; Tue, 10 Jun 2014 14:07:52 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WuMiN-0000N3-SM for xen-devel@lists.xensource.com; Tue, 10 Jun 2014 14:07:52 +0000 Received: from [85.158.139.211:59285] by server-9.bemta-5.messagelabs.com id 5A/E1-04350-73117935; Tue, 10 Jun 2014 14:07:51 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1402409267!9152999!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 11219 invoked from network); 10 Jun 2014 14:07:50 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 10 Jun 2014 14:07:50 -0000 X-IronPort-AV: E=Sophos; i="4.98,1009,1392163200"; d="scan'208"; a="141612262" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 10 Jun 2014 14:07:45 +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; Tue, 10 Jun 2014 10:07:43 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WuMiA-0006am-OT; Tue, 10 Jun 2014 15:07:38 +0100 From: Stefano Stabellini To: Date: Tue, 10 Jun 2014 15:07:09 +0100 Message-ID: <1402409240-28114-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, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v9 01/12] 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 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: 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. See ARM ARM B1.8.11 and chapter 5.4 of the Generic Interrupt Controller Architecture Specification. 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 577d85b..a449ef3 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -643,22 +643,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) || @@ -671,10 +655,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(); } static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)