From patchwork Wed Nov 19 15:41:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 41181 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B0AE1241C9 for ; Wed, 19 Nov 2014 15:43:25 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id n15sf602811lbi.6 for ; Wed, 19 Nov 2014 07:43:24 -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:in-reply-to:message-id :references: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=6xy7ultPLfI/SwooBlqxMwTYmcyvjoMslMep+2uT9As=; b=VyFlo7sQFD+f/9iidALPsWTvCrBOuCi9aYv+8mz6Yee3pULNs+TXcdMA4If+x5bYij LLShdw8TXU8j+NNvXpqUaKcsbTF2mgeaFlOTNGNCpbo9jlNC3OgZnItu1ASprQpBkm3/ GoKzeWymGQL3rpGVynoOjBiRbnJj63LHcDy07Hq/d0+eF/aHzKhNLieMYMUVbDfSCYQE XCtI2Ng7jtObKLwkdNB3LJZ9jO2EOXP2a7gY8yAivI25yQv6TcKUBO3qc0JaGvI0Vo4G lE4sx5381SfYOipKTFhlTTxXCjrVJnHiOwXul0IarAwA+QrMbAxIB59DxAwCkcfLhu5j bptw== X-Gm-Message-State: ALoCoQlQKcu03os9G4R0VEDrf7lE3J7a2NR/vRo6c40HT9fKk5ock3LK3yDaRdhcstuLSUHmfc2C X-Received: by 10.181.13.147 with SMTP id ey19mr5425849wid.2.1416411804580; Wed, 19 Nov 2014 07:43:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.100 with SMTP id it4ls1465633lac.7.gmail; Wed, 19 Nov 2014 07:43:24 -0800 (PST) X-Received: by 10.112.93.231 with SMTP id cx7mr2523361lbb.89.1416411804160; Wed, 19 Nov 2014 07:43:24 -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 xz9si2113857lbb.126.2014.11.19.07.43.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 07:43:24 -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 u10so725926lbd.3 for ; Wed, 19 Nov 2014 07:43:24 -0800 (PST) X-Received: by 10.112.45.102 with SMTP id l6mr6000622lbm.46.1416411803894; Wed, 19 Nov 2014 07:43:23 -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 ew9csp105053lbc; Wed, 19 Nov 2014 07:43:23 -0800 (PST) X-Received: by 10.224.11.137 with SMTP id t9mr54301177qat.10.1416411802589; Wed, 19 Nov 2014 07:43:22 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id l7si2306729qae.24.2014.11.19.07.43.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Nov 2014 07:43:22 -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 1Xr7Ny-000144-IY; Wed, 19 Nov 2014 15:41:38 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xr7Nw-00013y-G4 for xen-devel@lists.xen.org; Wed, 19 Nov 2014 15:41:36 +0000 Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id 6B/E4-27785-F2ABC645; Wed, 19 Nov 2014 15:41:35 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1416411692!13512768!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.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13677 invoked from network); 19 Nov 2014 15:41:35 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 19 Nov 2014 15:41:35 -0000 X-IronPort-AV: E=Sophos;i="5.07,417,1413244800"; d="scan'208";a="192914472" 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 10:41:29 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xr7No-0005Nv-NV; Wed, 19 Nov 2014 15:41:28 +0000 Date: Wed, 19 Nov 2014 15:41:08 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Andrii Tseglytskyi In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-DLP: MIA2 Cc: Julien Grall , "xen-devel@lists.xen.org" , Ian Campbell , Stefano Stabellini Subject: Re: [Xen-devel] Xen 4.5 random freeze question 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: On Wed, 19 Nov 2014, Andrii Tseglytskyi wrote: > Hi Stefano, > > On Wed, Nov 19, 2014 at 4:52 PM, Stefano Stabellini > wrote: > > On Wed, 19 Nov 2014, Andrii Tseglytskyi wrote: > >> Hi Stefano, > >> > >> > > if ( !list_empty(¤t->arch.vgic.lr_pending) && lr_all_full() ) > >> > > - GICH[GICH_HCR] |= GICH_HCR_UIE; > >> > > + GICH[GICH_HCR] |= GICH_HCR_NPIE; > >> > > else > >> > > - GICH[GICH_HCR] &= ~GICH_HCR_UIE; > >> > > + GICH[GICH_HCR] &= ~GICH_HCR_NPIE; > >> > > > >> > > } > >> > > >> > Yes, exactly > >> > >> I tried, hang still occurs with this change > > > > We need to figure out why during the hang you still have all the LRs > > busy even if you are getting maintenance interrupts that should cause > > them to be cleared. > > > > I see that I have free LRs during maintenance interrupt > > (XEN) gic.c:871:d0v0 maintenance interrupt > (XEN) GICH_LRs (vcpu 0) mask=0 > (XEN) HW_LR[0]=9a015856 > (XEN) HW_LR[1]=0 > (XEN) HW_LR[2]=0 > (XEN) HW_LR[3]=0 > (XEN) Inflight irq=86 lr=0 > (XEN) Inflight irq=2 lr=255 > (XEN) Pending irq=2 > > But I see that after I got hang - maintenance interrupts are generated > continuously. Platform continues printing the same log till reboot. Exactly the same log? As in the one above you just pasted? That is very very suspicious. I am thinking that we are not handling GICH_HCR_UIE correctly and something we do in Xen, maybe writing to an LR register, might trigger a new maintenance interrupt immediately causing an infinite loop. Could you please try this patch? It disable GICH_HCR_UIE immediately on hypervisor entry. diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 4d2a92d..6ae8dc4 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -701,6 +701,8 @@ void gic_clear_lrs(struct vcpu *v) if ( is_idle_vcpu(v) ) return; + GICH[GICH_HCR] &= ~GICH_HCR_UIE; + spin_lock_irqsave(&v->arch.vgic.lock, flags); while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask), @@ -821,12 +823,8 @@ void gic_inject(void) gic_restore_pending_irqs(current); - if ( !list_empty(¤t->arch.vgic.lr_pending) && lr_all_full() ) GICH[GICH_HCR] |= GICH_HCR_UIE; - else - GICH[GICH_HCR] &= ~GICH_HCR_UIE; - } static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)