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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8C707C433DF for ; Tue, 13 Oct 2020 11:09:32 +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 12F8C20659 for ; Tue, 13 Oct 2020 11:09:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gbkZIyPR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12F8C20659 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cP0vCeRx5dgoTZ/DR5Eu2knGbdGFtiv/5wYtmy/yo+k=; b=gbkZIyPRSytNQu3v6UR2RN0zs /B5C4zeLfrBhyQTxheeDP/NE3lERLGHcAzhW+sMFxtwkr88sosKqkgSUTavJbMmMDGHEsMNtyd2lS QmIpY7OD15zMstW5wBcvNI6tdWs3SsQtYmEekAqRzTXV99FHBefXxLXlCfVWP3GBV8+P6sZNL6QO9 EECKCgXh81VxtsLAbuxJLdV6MdKrfKBgZUTpTOBAkujztTjNl+eAwVanh2v04kzrv/eJVg9vUrJrG +3wkSan2nCZg7RR2F2MZjWM9VbHSRce0kZFtySEgL4si5xWCXP88psNlyaWBqkvr45VNd7qPl7Fl+ 6//SVPSwg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSIA6-0000hx-2L; Tue, 13 Oct 2020 11:08:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSIA3-0000gv-9u for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 11:08:08 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C29761FB; Tue, 13 Oct 2020 04:08:04 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.49.142]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 689D23F719; Tue, 13 Oct 2020 04:08:03 -0700 (PDT) Date: Tue, 13 Oct 2020 12:07:55 +0100 From: Mark Rutland To: Mark Brown Subject: Re: [RFC PATCH 2/3] arm64: stacktrace: Report when we reach the end of the stack Message-ID: <20201013110755.GA774@C02TD0UTHF1T.local> References: <20201012172605.10715-1-broonie@kernel.org> <20201012172605.10715-3-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201012172605.10715-3-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201013_070807_393062_CD7C430E X-CRM114-Status: GOOD ( 23.40 ) 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: Catalin Marinas , Miroslav Benes , Will Deacon , 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 On Mon, Oct 12, 2020 at 06:26:04PM +0100, Mark Brown wrote: > 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 Acked-by: Mark Rutland Mark. > --- > 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