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 X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7CCFC433DF for ; Mon, 12 Oct 2020 17:32:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CE5020797 for ; Mon, 12 Oct 2020 17:32:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FcbElzot"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="GqOXLMCf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CE5020797 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lMS3fjoXGS6/JaIqXXlLrRMzRHP106GOOOcPWhKB50E=; b=FcbElzotGCp9xOB9RUXmYsYLt UXrjhGZmwbjjNCaLwh8c6L7yyg0aGdF79zbbZC8+xyANuD/dk2vWvtpioITrQ6CBgK1TVUJW3iIZ3 5BZHlYwF9kCJQ8eVN3FghKvyPE3bnguYa/D+CYXUsfVf42Wpenfn0/gUmfpvyfwSDDkaJrlHlB0k0 2V+ZMjaIZ60496CCNqgD2kEAqB9sRGbaqWKOkf94ROU7dZ5TMBtBaGy4WUpZq5X9kw3tB92uBbcSm M+VGAkr4ObbZDQEWcNrd5iZyyXIiAJdgEsn6FfIFmUXY1zIWDpzgFskUNUi0dxrvvjE38pKfm/m24 kIdgGBsaQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kS1fR-0006qZ-NR; Mon, 12 Oct 2020 17:31:25 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kS1fN-0006pP-Ae for linux-arm-kernel@lists.infradead.org; Mon, 12 Oct 2020 17:31:22 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3617B20797; Mon, 12 Oct 2020 17:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602523880; bh=H1LaAJFAAqMqaFYieyy7vm7kHp2nCHOkAJDQFVpqPMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GqOXLMCfSVeRB7XjVmDtuclpb3erCkpDoC3So3fHZ2v9APjoX+Cfg39PyAnLW/Aru RlxfhVnarUnT4/bfiw+qENbcSSFDdoDqbyTbdHnNS7R/y3EEJHfiDwoYhfGoL1XdcR AIZ2d8MR2qmKJBAUzs7xXkKadFJpl/rCGdzD1vzI= From: Mark Brown To: Catalin Marinas , Will Deacon Subject: [RFC PATCH 2/3] arm64: stacktrace: Report when we reach the end of the stack Date: Mon, 12 Oct 2020 18:26:04 +0100 Message-Id: <20201012172605.10715-3-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201012172605.10715-1-broonie@kernel.org> References: <20201012172605.10715-1-broonie@kernel.org> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; g=a7b36805f8aae3277c30547457a19a293395e201; i=KD9PI0x+4qv52vK0FVTQ02vh9qmEulgPYYkbN1KAkK0=; m=xnSj1lSOpXs6VgpjqupoQkH4KVc8r51RhiaxVs3WUMg=; p=OQnEHpynaaOpda0OWcf/nV8a7+Swf1wwuNChr3Iq7JA= X-Patch-Sig: m=pgp; i=broonie@kernel.org; s=0xC3F436CA30F5D8EB; b=iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl+EkSgACgkQJNaLcl1Uh9DP8wf9FkD xVvP1pT+JmkaB9fPFpcO0bh/IC3EmMGOZucDW64k/TVO2bpFeloCWHXhbY6k+/8AzLqurJik8b8SU pmrumGYOqCnMDOTYO+wZNoJFD9/JdwG3xWVDg0zSzUb/srt60R5i7dhzaEeBAJkoqIsaZZXgCs42h HgcldU77aLVIThkgM1tgJlqrvb+St34/CQfXPajvsG+HkbcXzOMVlEIAsGp/+P99frIm6KHWnzl+P Lt50CzArh1UCV9Fj/oxz2ciyQXKVtPqH+HrVLoSPGH+yBjTTYfYJ7HZ3SS2mDtZC1co86/5ohJ/7Y WzuoryurV+TWmUF+Z/+RaKsKSwPdAYg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201012_133121_454383_FE0FACB0 X-CRM114-Status: GOOD ( 17.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Mark Brown , Miroslav Benes , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently the arm64 unwinder code returns -EINVAL whenever it can't find the next stack frame, not distinguishing between cases where the stack has been corrupted or is otherwise in a state it shouldn't be and cases where we have reached the end of the stack. At the minute none of the callers care what error code is returned but this will be important for reliable stack trace which needs to be sure that the stack is intact. Change to return -ENOENT in the case where we reach the bottom of the stack. The error codes from this function are only used in kernel, this particular code is chosen as we are indicating that we know there is no frame there. Signed-off-by: Mark Brown --- arch/arm64/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 0fb42129b469..ad20981dfda4 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c @@ -46,7 +46,7 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) /* Terminal record; nothing to unwind */ if (!fp) - return -EINVAL; + return -ENOENT; if (fp & 0xf) return -EINVAL; -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel