From patchwork Wed Nov 19 17:44:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 41203 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B66E6241C9 for ; Wed, 19 Nov 2014 17:59:36 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id k14sf699221wgh.0 for ; Wed, 19 Nov 2014 09:59:36 -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:date:from:to:message-id:user-agent :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=3bMgYqlKZL49RxLU2qrdf5GiDU/xkIf6yUDvPCr7HDI=; b=FEY8/hXk/jBVrBZnR2Zxb/yp72EUMEGonXTqcrFgTN6s4SHl7PiQLf0gDkUt0+W9u3 LhDwYSSZAAaoW3ewnbwxQx/o/+7DKi7C8wFSAtv3wS5dbMWhWqXtoodlbq3Z//70Ruk2 XIvLGphnZAcEK/V5rO1HkI9NsweUCL211NP1YhnH74GzX3uF+H6vC6EKYX+pKwXafHp3 hXPqgjqZmAw9YfR9I7mWy0ACfXxc3bJQFspoqgtRrbQxSS6feWUaBf8uhfs8pAUb1bJx yluGUol9SZ6hKAri9vMMmTkvnX5DJjtKcnNG0Y8pndsfcoGqtpLXoqbYexmP/Jknf1fM zNbg== X-Gm-Message-State: ALoCoQn3xXzyItMhD3apLrLv5OKxIwPzel2LD4r8K7Uq+rBiHeRtGhgnh9RnYerJCjc5fREv6aE1 X-Received: by 10.112.142.36 with SMTP id rt4mr16507325lbb.3.1416419975906; Wed, 19 Nov 2014 09:59:35 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.170 with SMTP id p10ls342269lal.35.gmail; Wed, 19 Nov 2014 09:59:35 -0800 (PST) X-Received: by 10.112.150.102 with SMTP id uh6mr6840221lbb.50.1416419975721; Wed, 19 Nov 2014 09:59:35 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id c1si2571458lbv.23.2014.11.19.09.59.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 09:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id u10so952985lbd.17 for ; Wed, 19 Nov 2014 09:59:35 -0800 (PST) X-Received: by 10.152.37.69 with SMTP id w5mr6562834laj.67.1416419975573; Wed, 19 Nov 2014 09:59:35 -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.112.184.201 with SMTP id ew9csp130577lbc; Wed, 19 Nov 2014 09:59:34 -0800 (PST) X-Received: by 10.224.46.5 with SMTP id h5mr55055921qaf.26.1416419974483; Wed, 19 Nov 2014 09:59:34 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id l8si2625823qaf.128.2014.11.19.09.59.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Nov 2014 09:59:34 -0800 (PST) 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 1Xr9Vv-0007e7-BR; Wed, 19 Nov 2014 17:57:59 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xr9Vu-0007dy-Br for xen-devel@lists.xensource.com; Wed, 19 Nov 2014 17:57:58 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 7E/DB-05632-52ADC645; Wed, 19 Nov 2014 17:57:57 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-2.tower-31.messagelabs.com!1416419872!12499174!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.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20168 invoked from network); 19 Nov 2014 17:57:55 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-2.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 19 Nov 2014 17:57:55 -0000 X-IronPort-AV: E=Sophos;i="5.07,418,1413244800"; d="scan'208";a="194484459" 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; Wed, 19 Nov 2014 12:45:11 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xr9JW-0007hb-TC; Wed, 19 Nov 2014 17:45:10 +0000 Date: Wed, 19 Nov 2014 17:44:49 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-DLP: MIA2 Cc: Julien Grall , xen-devel@lists.xensource.com, andrii.tseglytskyi@globallogic.com, Ian Campbell , Stefano Stabellini Subject: [Xen-devel] [PATCH for-4.5] xen/arm: clear UIE on hypervisor entry 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.217.172 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: UIE being set can cause maintenance interrupts to occur when Xen writes to one or more LR registers. The effect is a busy loop around the interrupt handler in Xen (http://marc.info/?l=xen-devel&m=141597517132682): everything gets stuck. Konrad, this fixes an actual bug, at least on OMAP5. It should have no bad side effects on any other platforms as far as I can tell. It should go in 4.5. Signed-off-by: Stefano Stabellini Tested-by: Andrii Tseglytskyi diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 70d10d6..df140b9 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -403,6 +403,8 @@ void gic_clear_lrs(struct vcpu *v) if ( is_idle_vcpu(v) ) return; + gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0); + spin_lock_irqsave(&v->arch.vgic.lock, flags); while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask), @@ -527,8 +529,6 @@ void gic_inject(void) if ( !list_empty(¤t->arch.vgic.lr_pending) && lr_all_full() ) gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 1); - else - gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0); } static void do_sgi(struct cpu_user_regs *regs, enum gic_sgi sgi)