Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5067400imm; Tue, 18 Sep 2018 03:55:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaCy4B2sgQP7B+1umxRv5/UBXnMZ1nGPFk2Vj6F4dqcBn5k+L8/2XmCoUitPw/Z/CEh9UCS X-Received: by 2002:a17:902:6845:: with SMTP id f5-v6mr29265753pln.17.1537268156988; Tue, 18 Sep 2018 03:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537268156; cv=none; d=google.com; s=arc-20160816; b=V9oqB8Hbahm6LQs8LPcp4IqBQvb/oJiktW0wd6TNez/UiIfw4SiPYKBssck9hDtS+2 18nijAa538TbTJanXtts4rsMIbfKNSm8v6YtSPw8gHl+LOoEJ6gT075CnE9ZUd2YNtnc FBqAGv13gr5yb2QuhkZ44hm9RixzCgAkgkmFOEFAYYevSLMK2xFICScwu9nyYCwLP3EE PhRynlx36BiKrea0jmmsK3FUWsQonruSuNIJ5HTahdoGnek2DI0tskU6BFmKw3ekp6hw etiLxHcDMfNmys8Ypl+Wkc5dXCJgDi8y3HlTtRnL0pWILl8ZbtGyzFCuYBXlQuB98WuC qInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=/LYruFn9jFEDZVcVYrqYJRrHMH+PfD1ODsFjuRB9EOU=; b=ixmpYsSZeQxttfrY6gRwBpVbh20/krbet6hP3KukiEbDsbXoHTrQImLCxoVW6qaFfM rxoCDuUfM0SS3CY9tc3HA1HiojS7UiEeo0JYoinWrAnODLAdRZCvJN6i0duqovq7hRVs W4addo9bryXN96aNLEdr/e7wb9XNgvDZA12ieGWmhHHLJU3TQsMbe+K06ffD80VeJmp6 3uCz4zMKU2XLOg01Naym+pqj+nmeDGtYZSro2yPxYLc0Ppoe3cCMEt+k6ggEiJ5fxIxI g0GiSkVizg327WiPlbS/fyhGfw38KfPheyPwQHhJNVwEgH42tzXtgvk9U7M8RTpYrxkz ZT2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s195-v6si18065623pgs.492.2018.09.18.03.55.41; Tue, 18 Sep 2018 03:55:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbeIRQ1i (ORCPT + 99 others); Tue, 18 Sep 2018 12:27:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53920 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbeIRQ1i (ORCPT ); Tue, 18 Sep 2018 12:27:38 -0400 Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E9F2D308AA15; Tue, 18 Sep 2018 10:55:35 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B197F86BBA; Tue, 18 Sep 2018 10:55:35 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w8IAtZKb030098; Tue, 18 Sep 2018 06:55:35 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w8IAtYpW030094; Tue, 18 Sep 2018 06:55:34 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 18 Sep 2018 06:55:34 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Sasha Levin cc: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Will Deacon Subject: Re: [PATCH AUTOSEL 4.18 032/136] arm64: fix infinite stacktrace In-Reply-To: <20180917030006.245495-32-alexander.levin@microsoft.com> Message-ID: References: <20180917030006.245495-1-alexander.levin@microsoft.com> <20180917030006.245495-32-alexander.levin@microsoft.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 18 Sep 2018 10:55:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch is not correct, because the stacktrace is supposed to work around discontiguous interrupt stacks. You should replace 'frame->fp <= fp' with 'frame->fp == fp'. Mikulas On Mon, 17 Sep 2018, Sasha Levin wrote: > From: Mikulas Patocka > > [ Upstream commit 7e7df71fd57ff2894d96abb0080922bf39460a79 ] > > I've got this infinite stacktrace when debugging another problem: > [ 908.795225] INFO: rcu_preempt detected stalls on CPUs/tasks: > [ 908.796176] 1-...!: (1 GPs behind) idle=952/1/4611686018427387904 softirq=1462/1462 fqs=355 > [ 908.797692] 2-...!: (1 GPs behind) idle=f42/1/4611686018427387904 softirq=1550/1551 fqs=355 > [ 908.799189] (detected by 0, t=2109 jiffies, g=130, c=129, q=235) > [ 908.800284] Task dump for CPU 1: > [ 908.800871] kworker/1:1 R running task 0 32 2 0x00000022 > [ 908.802127] Workqueue: writecache-writeabck writecache_writeback [dm_writecache] > [ 908.820285] Call trace: > [ 908.824785] __switch_to+0x68/0x90 > [ 908.837661] 0xfffffe00603afd90 > [ 908.844119] 0xfffffe00603afd90 > [ 908.850091] 0xfffffe00603afd90 > [ 908.854285] 0xfffffe00603afd90 > [ 908.863538] 0xfffffe00603afd90 > [ 908.865523] 0xfffffe00603afd90 > > The machine just locked up and kept on printing the same line over and > over again. This patch fixes it. > > Signed-off-by: Mikulas Patocka > Signed-off-by: Will Deacon > Signed-off-by: Sasha Levin > --- > arch/arm64/kernel/stacktrace.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c > index d5718a060672..e160ca123da3 100644 > --- a/arch/arm64/kernel/stacktrace.c > +++ b/arch/arm64/kernel/stacktrace.c > @@ -56,6 +56,9 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) > frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp)); > frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8)); > > + if (frame->fp <= fp) > + return -EINVAL; > + > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > if (tsk->ret_stack && > (frame->pc == (unsigned long)return_to_handler)) { > -- > 2.17.1 >