From patchwork Wed Mar 19 12:31:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 26575 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 276F520560 for ; Wed, 19 Mar 2014 12:34:35 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id gq1sf31800979obb.11 for ; Wed, 19 Mar 2014 05:34:35 -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=cjLZ0IS7Sqj5VcKSXc+Fr687oEeFQxnjz8YBlDArVak=; b=g4W6tvncdpOSXn6tjOXj2mh0KnphD95izl1lZuv7XOFCEwEKOrEaKsBoGCq/R024nS 6BCPCmfHvrXGk5BpDiv0ng8kZR/zfFBLd7noHQ9hmD9jXqbsGrFXQ5r1eEK6x4mj9nTR fFRZhPAVLwM5gnvT/baYB97G57h3ssukt63jhTBvxGe+aOtJ66DffUMAtfNmQVRELhUI GZ3M5sn2u2jpIS3AizY1ytgWhOYuhrwR/2rKhuKjreDigJG2fjdbM++bb0Yj+MjFOfcK qTllgnDygYDu7Hyx1mAFNLhdvn5Vkgz/MMRJdDtDXhczVXhrWu4pbkRF+R9kqTGXOy+e UG2Q== X-Gm-Message-State: ALoCoQl+9hUm78mc+Cy3qtzCfo6ZCHCHRokyzYg7CTSIo8gjIYAtX53baebdFCniJCjYK6wGP0QS X-Received: by 10.43.100.129 with SMTP id cw1mr12281943icc.30.1395232475255; Wed, 19 Mar 2014 05:34:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.196 with SMTP id 62ls1771432qgt.76.gmail; Wed, 19 Mar 2014 05:34:35 -0700 (PDT) X-Received: by 10.52.171.68 with SMTP id as4mr25650633vdc.0.1395232475104; Wed, 19 Mar 2014 05:34:35 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id e10si7646589vcq.2.2014.03.19.05.34.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 05:34:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so9002661vcb.33 for ; Wed, 19 Mar 2014 05:34:35 -0700 (PDT) X-Received: by 10.52.113.1 with SMTP id iu1mr715318vdb.35.1395232475005; Wed, 19 Mar 2014 05:34:35 -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 i9csp295264vck; Wed, 19 Mar 2014 05:34:34 -0700 (PDT) X-Received: by 10.52.15.132 with SMTP id x4mr1585365vdc.31.1395232473940; Wed, 19 Mar 2014 05:34:33 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w14si7643882vco.3.2014.03.19.05.34.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Mar 2014 05:34:33 -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 1WQFfo-0007T9-If; Wed, 19 Mar 2014 12:32:44 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQFfk-0007PU-NZ for xen-devel@lists.xensource.com; Wed, 19 Mar 2014 12:32:41 +0000 Received: from [85.158.143.35:58954] by server-3.bemta-4.messagelabs.com id 68/BD-13602-76E89235; Wed, 19 Mar 2014 12:32:39 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1395232356!3212920!3 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 19060 invoked from network); 19 Mar 2014 12:32:38 -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:38 -0000 X-IronPort-AV: E=Sophos;i="4.97,685,1389744000"; d="scan'208";a="112829418" 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-JZ; Wed, 19 Mar 2014 12:32:30 +0000 From: Stefano Stabellini To: Date: Wed, 19 Mar 2014 12:31:59 +0000 Message-ID: <1395232325-19226-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, jtd@galois.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v4 04/10] xen/arm: set GICH_HCR_UIE 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.220.174 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_UIE 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 Acked-by: Julien Grall --- Changes in v2: - disable/enable the GICH_HCR_UIE bit in GICH_HCR; - only enable GICH_HCR_UIE if this_cpu(lr_mask) == ((1 << nr_lrs) - 1). --- xen/arch/arm/gic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 32d3bea..d445e8b 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -790,6 +790,12 @@ void gic_inject(void) vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq); gic_restore_pending_irqs(current); + + if ( !list_empty(¤t->arch.vgic.lr_pending) && + this_cpu(lr_mask) == ((1 << nr_lrs) - 1) ) + GICH[GICH_HCR] |= GICH_HCR_UIE; + else + GICH[GICH_HCR] &= ~GICH_HCR_UIE; } int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,