From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43D01C3ABA2 for ; Mon, 16 Sep 2024 10:48:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C9vK2+xE6RQL04fLyFT/DoaW+jwjttJNU3lNMGLCHjM=; b=J5BxhB4M7EbaiRyOYIA2Ng53pU oYIIGoMmLfR0zjfDOuYdjcqPQ4IUCwIUNnULuIz7eKLHDdt6u1ZXpoSfS+dTeK+bt1zJ+Xd5fM4ve 3huKNGSlgg2N0F4rntmsF2XNHksq81+i4JokYE3G99k5jdrMU5gmsArZJr/vbVu+q+br8ojbL0rZ0 JmfMwJCnqm8/gRqqDw2+SlcU/NCu/yBwI3ZMNagEW/47FPh+ZxKWL15TSJ1ReBusTqYsERLAwteLR kwNuFxAYE0I3Lbb7kFc7jW/PFyb7N0nZI1hLRFkav7NxhaZoV5F3ScG3pD+1l/aVDYDDfCL32TUzw JTPSjzzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sq9Gv-00000003m8p-0Tl3; Mon, 16 Sep 2024 10:47:57 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sq96z-00000003jxd-0OQH for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2024 10:37:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id E458AA41B80; Mon, 16 Sep 2024 10:37:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14A9BC4CEC4; Mon, 16 Sep 2024 10:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726483059; bh=P2KQGR7EXPM94ax8edp9oKQsLIadoOZ/jHl07AfggfQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pi+2QqYx84IcBorzbtI+U/xE/lGiaBgz3HVozDXG8ywM4HjoIGMaUHCKByqNljiv8 R9aOFu5QZRBHOVsS6W1MdYAxstWdYT46mKnl9DwK/JcmzHVzbq/pYzrWgY4VcDtrzq ERQqcrp3GCknXITRt7i9kvTBwBtSWSCAXJWrgnmQYBDA8vbuztic8t1auFO5mKzhB2 E3A7x2Nn55M5+OoouV/e/mQNmzn4UyLZgracF1Cyi8qURLgdUnY9R900h44dz6WmBO x3g/Zif5mySqzY46XplP0Qdc4yT2bqY60U750xV+2ejWOr6S2wBbJZgJ/0e/cqGQDf 92HGXRg36ZNiw== From: Puranjay Mohan To: Oleg Nesterov , Steven Rostedt , Masami Hiramatsu , Catalin Marinas , Will Deacon , Mark Rutland , Mark Brown , Kalesh Singh , chenqiwu Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: arm64: stacktrace: WARN_ON(state->common.pc == orig_pc) in kunwind_recover_return_address() In-Reply-To: <20240916102741.GA13899@redhat.com> References: <20240916102741.GA13899@redhat.com> Date: Mon, 16 Sep 2024 10:37:31 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240916_033741_287115_BDDAD354 X-CRM114-Status: GOOD ( 14.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --=-=-= Content-Type: text/plain Oleg Nesterov writes: > I don't know the details but people report that > kunwind_recover_return_address() hits this warning. > > I know absolutely nothing about arm64 or kernel/trace/fgraph.c, but at > first glance this code looks broken: > > kunwind_recover_return_address: > > ... > > orig_pc = ftrace_graph_ret_addr(state->task, NULL, > state->common.pc, > (void *)state->common.fp); > if (WARN_ON_ONCE(state->common.pc == orig_pc)) > > ftrace_graph_ret_addr: > > ... > > if (!idx) > return ret; > > > given that kunwind_recover_return_address() passes idx == NULL to > ftrace_graph_ret_addr(), it should always return ret == state->common.pc ? > > > Perhaps this connects to 29c1c24a27 ("function_graph: Fix up ftrace_graph_ret_addr()") > and I have no idea if something like the patch below makes any sense. > Your finding is accurate. It has been fixed in upstream by c060f93253ca ("arm64: stacktrace: fix the usage of ftrace_graph_ret_addr()") See: https://elixir.bootlin.com/linux/v6.11/source/arch/arm64/kernel/stacktrace.c#L111 Thanks, Puranjay --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIoEARYKADIWIQQ3wHGvVs/5bdl78BKwwPkjG3B2nQUCZugKbBQccHVyYW5qYXlA a2VybmVsLm9yZwAKCRCwwPkjG3B2nU0XAQD2X6uLg0VyJNcwY/L5WcIDB61aPU1y mRy5eiriORWjFgEAtBeRZmqeajKlWSyUFfaNZcjqBAr6G7ndhjcujPv6KAI= =gAQR -----END PGP SIGNATURE----- --=-=-=--