From patchwork Fri Feb 7 18:56:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 24315 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6647A2096A for ; Fri, 7 Feb 2014 18:58:29 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id w17sf8427031vbj.9 for ; Fri, 07 Feb 2014 10:58:28 -0800 (PST) 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=/bJQoLzcXkH2IySpBXSrakwryuWJ/CKpm7TzHYaB9mg=; b=a+S/cDXwgEQJlhIEsoAmwBfWYrN0+q0JuNUPqLv34gWRa0sODu/4bWR5R14ltQqWAo PdXIovOo9qVhZ7MU/IRGNXhof1waMqUWpkAKMfa2t5CzTCPR+jOSMNhq8Mbj5IZCOQSC 3Tnbq8OVJZsF9Y17J+2tcGMakwFXx/jMyvrMoOZDAJDqMwXyypebjNfYPlyyYfqoXjMN TAgt6EMpYpIAHzJUnPuT0/kthp51/uFO//CV31RkGNQsjH/10aDxx45fCpcSX+U/dVPE auwYQZ5jO2hEeIWotaBxlAFF3ysV/Z6vkt1pCbSkhdhMEXqtVuu/1jjPciiZg18Vur5a W0bA== X-Gm-Message-State: ALoCoQk2yXjXlhmRhyIty0dgvxapopvPoVgc4LkKlX7brEe58rh8GuSE14xBx4lgSwOFuTRGbLdo X-Received: by 10.58.47.99 with SMTP id c3mr3085679ven.41.1391799508331; Fri, 07 Feb 2014 10:58:28 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.227 with SMTP id m90ls1240476qga.38.gmail; Fri, 07 Feb 2014 10:58:28 -0800 (PST) X-Received: by 10.58.219.1 with SMTP id pk1mr282183vec.49.1391799508264; Fri, 07 Feb 2014 10:58:28 -0800 (PST) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id dr8si1618745vcb.88.2014.02.07.10.58.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 10:58:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.52; Received: by mail-vb0-f52.google.com with SMTP id p14so2884583vbm.25 for ; Fri, 07 Feb 2014 10:58:28 -0800 (PST) X-Received: by 10.58.145.9 with SMTP id sq9mr282415veb.53.1391799508189; Fri, 07 Feb 2014 10:58:28 -0800 (PST) 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.174.196 with SMTP id u4csp128279vcz; Fri, 7 Feb 2014 10:58:27 -0800 (PST) X-Received: by 10.140.34.207 with SMTP id l73mr23552535qgl.85.1391799505668; Fri, 07 Feb 2014 10:58:25 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id r5si4263232qga.39.2014.02.07.10.58.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Feb 2014 10:58:25 -0800 (PST) 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 1WBqbT-00020L-N3; Fri, 07 Feb 2014 18:56:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WBqbS-0001zC-6y for xen-devel@lists.xensource.com; Fri, 07 Feb 2014 18:56:42 +0000 Received: from [85.158.137.68:64431] by server-6.bemta-3.messagelabs.com id 46/2F-09180-96C25F25; Fri, 07 Feb 2014 18:56:41 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1391799398!403618!2 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.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2575 invoked from network); 7 Feb 2014 18:56:40 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 7 Feb 2014 18:56:40 -0000 X-IronPort-AV: E=Sophos;i="4.95,802,1384300800"; d="scan'208";a="100916614" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 07 Feb 2014 18:56:38 +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.2.342.4; Fri, 7 Feb 2014 13:56:37 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WBqbI-0000vD-Jt; Fri, 07 Feb 2014 18:56:32 +0000 From: Stefano Stabellini To: Date: Fri, 7 Feb 2014 18:56:18 +0000 Message-ID: <1391799378-31664-4-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-4.5 4/4] xen/arm: set GICH_HCR_NPIE if all the LRs are in use 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.212.52 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: On return to guest, if there are no free LRs and we still have more interrupt to inject, set GICH_HCR_NPIE so that we are going to receive a maintenance interrupt when no pending interrupts are present in the LR registers. The maintenance interrupt handler won't do anything anymore, but receiving the interrupt is going to cause gic_inject to be called on return to guest that is going to clear the old LRs and inject new interrupts. Signed-off-by: Stefano Stabellini --- xen/arch/arm/gic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 87bd5d3..bee2618 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -810,8 +810,14 @@ void gic_inject(void) gic_restore_pending_irqs(current); if (!gic_events_need_delivery()) gic_inject_irq_stop(); - else + else { gic_inject_irq_start(); + } + + if ( !list_empty(¤t->arch.vgic.lr_pending) ) + GICH[GICH_HCR] = GICH_HCR_EN | GICH_HCR_NPIE; + else + GICH[GICH_HCR] = GICH_HCR_EN; } int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,