From patchwork Mon Nov 17 18:02:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 40973 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BA61A21F5F for ; Mon, 17 Nov 2014 18:11:44 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf1801550wiw.4 for ; Mon, 17 Nov 2014 10:11:44 -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=9D2v+QV4e5+Z7++bIu4NplK4LoOq3BYYp2hrtl8OX6U=; b=hykt19TJ1mJwYR2RsvDR0MWDK39BkXtH7BlniI87mn90gUfmc1zbQyOY88aWZGHUJW 2uFri5T3dTslfzitG/Nvs7m/nE18HP6dNgohMlD+eVonr4lyntFeMo5/9Nx6QXCCjQcJ 8n3W83Xj1jGAtWM1b7lX0IygmegEFFDyVkVpXmpkCWpRAGci+ipTxxzvzIijzZ2crOC7 griFuenANGvAzOEsYhfUR/dlmMQu82yDIoBhY3bbJkZmzyUzWjXrODq41+aPlSI0Ckpj 2a6zSYwEZPrg1Ut/ReBNLDW1QvF+2TZAh09XMIwbmNlGC26ATLcvB8dK9b6V5/bLXBih LyIQ== X-Gm-Message-State: ALoCoQkppSct5NkDOb/8C8+XxYrlPqpITYGQu1FJ8q4YMToQbbmsPVdqfGI5pgFlDTYAVI5KFCLi X-Received: by 10.180.94.3 with SMTP id cy3mr4685325wib.7.1416247511037; Mon, 17 Nov 2014 10:05:11 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.133 with SMTP id r5ls1095556laa.65.gmail; Mon, 17 Nov 2014 10:05:10 -0800 (PST) X-Received: by 10.152.19.37 with SMTP id b5mr12286452lae.80.1416247510450; Mon, 17 Nov 2014 10:05:10 -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 j1si28735746laf.36.2014.11.17.10.05.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 10:05:10 -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 u10so8963759lbd.3 for ; Mon, 17 Nov 2014 10:05:10 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr29339110lbc.23.1416247510320; Mon, 17 Nov 2014 10:05:10 -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 ew9csp1200343lbc; Mon, 17 Nov 2014 10:05:09 -0800 (PST) X-Received: by 10.220.187.8 with SMTP id cu8mr21295771vcb.31.1416247508719; Mon, 17 Nov 2014 10:05:08 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id y15si24687058vct.59.2014.11.17.10.04.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Nov 2014 10:05:08 -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 1XqQdA-0004eT-N2; Mon, 17 Nov 2014 18:02:28 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XqQd9-0004eI-I7 for xen-devel@lists.xen.org; Mon, 17 Nov 2014 18:02:27 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 12/89-22737-2383A645; Mon, 17 Nov 2014 18:02:26 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1416247343!11893442!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 32308 invoked from network); 17 Nov 2014 18:02:26 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 17 Nov 2014 18:02:26 -0000 X-IronPort-AV: E=Sophos;i="5.07,404,1413244800"; d="scan'208";a="193642628" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Mon, 17 Nov 2014 13:02:20 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XqQd1-00012A-Kq; Mon, 17 Nov 2014 18:02:19 +0000 Date: Mon, 17 Nov 2014 18:02:00 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Andrii Tseglytskyi In-Reply-To: Message-ID: References: <54662F69.8060700@linaro.org> 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 Mon, 17 Nov 2014, Andrii Tseglytskyi wrote: > Hi Stefano, > > Thank you for your answer. > > On Mon, Nov 17, 2014 at 6:39 PM, Stefano Stabellini > wrote: > > Although it is possible that that patch is the cause of your problem, > > unfortunately it is part of a significant rework of the GIC driver in > > Xen and I am afraid that testing with only a portion of that patch > > series might introduce other subtle bugs. For your reference the series > > starts at commit 6f91502be64a05d0635454d629118b96ae38b50f and ends at > > commit 72eaf29e8d70784aaf066ead79df1295a25ecfd0. > > > > Yes, I tested with and without the whole series. And the result is that the series causes the problem? > > If 5495a512b63bad868c147198f7f049c2617d468c is really the cause of your > > problem, one idea that comes to mind is that GICH_LR_MAINTENANCE_IRQ > > might not work correctly on your platform. It wouldn't be the first time > > that we see hardware behaving that way, especially if you are using the > > GIC secure registers instead of the non-secure register as GICH_LRn.HW > > can only deactivate non-secure interrupts. This is usually due to a > > configuration error in u-boot. > > > > Could you please try to set PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI for your > > platform? > > > > I tried this. Unfortunately it doesn't help. Could you try the following patch on top of 5495a512b63bad868c147198f7f049c2617d468c ? diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 302c031..a286376 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -557,10 +557,8 @@ static inline void gic_set_lr(int lr, struct pending_irq *p, BUG_ON(lr < 0); BUG_ON(state & ~(GICH_LR_STATE_MASK<priority >> 3) << GICH_LR_PRIORITY_SHIFT) | + lr_val = state | GICH_LR_MAINTENANCE_IRQ | ((p->priority >> 3) << GICH_LR_PRIORITY_SHIFT) | ((p->irq & GICH_LR_VIRTUAL_MASK) << GICH_LR_VIRTUAL_SHIFT); - if ( p->desc != NULL ) - lr_val |= GICH_LR_HW | (p->desc->irq << GICH_LR_PHYSICAL_SHIFT); GICH[GICH_LR + lr] = lr_val; @@ -622,6 +620,12 @@ out: return; } +static void gic_irq_eoi(void *info) +{ + int virq = (uintptr_t) info; + GICC[GICC_DIR] = virq; +} + static void gic_update_one_lr(struct vcpu *v, int i) { struct pending_irq *p; @@ -639,7 +643,10 @@ static void gic_update_one_lr(struct vcpu *v, int i) irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK; p = irq_to_pending(v, irq); if ( p->desc != NULL ) + { + gic_irq_eoi((void*)(uintptr_t)irq); p->desc->status &= ~IRQ_INPROGRESS; + } clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status); if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) && test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))