From patchwork Tue Jul 26 07:37:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 12928980 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 CA306C433EF for ; Tue, 26 Jul 2022 07:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Qa18ZE262pnQ+Wur8XpWS0ykR5KMxB2XqiBONKeV0/E=; b=I+Zmi1cDcONnjnb3eriJw21C6l EkkMXMzaWSNuIt6AHCJlAk7cXX3GXjRgGyBtwc8vz9PDEbtHU/HTxFI9dRXwC8l+ydqdcx03dPjWp jLnob0ZFi5RIQwC9LHRtAjzOK0vQM8sPSIo7wxiXoop5yjpL18jDbRb7zaS/ARcVsNurUgF5dG3hx GYYaUm2fpsXYEOYWt3X/aFmJqKHtWf09NfRXKUlqwr8lidofIkE7/itenMHta67zw6EyH/j+tmwM2 LL+idVXLHiS/27T0ixngGvKITupQ0WJ/6Lz8AHj1TK7ylrfhwVd6uKWT9iY0Mf8yxioXPrAf6EC0j /jGD6dfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGF9t-009WQ9-JS; Tue, 26 Jul 2022 07:39:14 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGF8t-009VjG-Gt for linux-arm-kernel@lists.infradead.org; Tue, 26 Jul 2022 07:38:12 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 83-20020a250156000000b006707fbc22ddso10435706ybb.3 for ; Tue, 26 Jul 2022 00:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc:content-transfer-encoding; bh=VavrLtXbRNR5iYY6DuWJsiPM2oJzRiMbR593lo0d1Rw=; b=j96IaEX62h71DWb6L/1x3UIPVuOe11L4SskRUNLfEpqgu2vu4jVoT7hkbCAryRObVn Zi9PUjFc3msAp6dAeAxLeAvs5ursb0jnWMfa66uohrRUKiYMKU6skuOaJAlmHKMEnNXn osaNYizMUsQjs8peiYd/0YDjLYH7izn6TGf8Vejoqckt5OSYyCR7wAWcWajSZnntZDeQ G8qLCUQzdjzgvYlwgCnfYmJjBnkmOh5UZMKCFOUAbItZYA5Di/+5IJKFfMmR5lxLeFg+ 6H5z7pSY/XdyftcagV0boM4TJERzjbvtdEnrnWDxPwe3kwN/CDSKVtd3hu6+6QLzA8Z7 0jDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc:content-transfer-encoding; bh=VavrLtXbRNR5iYY6DuWJsiPM2oJzRiMbR593lo0d1Rw=; b=x+inj669gpd9lxeC7bNKxGdTCEusq4fPW/r4NicmxV24YgWZXVwhMJJNcr4rhYeIVg 62KbE3IqdozlU28cWkaQ7WCbYKlZgyvXswnwz3fzizQr6vlPQmdwNdCqB7YbRuM/gBqN 8xGAJavfAk85UsBogk8InfEDTKoph1frD/fjWcrIVi5+kHjLRmEwZJGh3CX3KH3uDsCZ xTTri33KKeHAKBcskeEvT0Jt+EEDorB2Z6aF6IhFrCb1rHzT4/S+PxueodTHS4X0ykT0 0WM5JSbvgaVS0shALr18ObI3u+d3JdwKH6ZVNNsrIan7mI+8dgZWlc6HSjkf2EmxZRLe yjfw== X-Gm-Message-State: AJIora+OT+bTC1AmNX0ZE1LOfSqFb1okBCJ5+UdEK144F0kJr7wo3mLG BWFT6Hd3yp/LbkTjqRV2qHvPsMnPAnspSRr0UQ== X-Google-Smtp-Source: AGRyM1uLngP1y5rfZv7qcR91UDrsOk5KX5o+Z2nFXgrbRkoOxYN5kjOvh7dIZvVEJTbG63rkQ3WbCIEv9Qf04bN+kA== X-Received: from kaleshsingh.mtv.corp.google.com ([2620:15c:211:200:4f77:3b64:736a:394e]) (user=kaleshsingh job=sendgmr) by 2002:a81:1b97:0:b0:2db:640f:49d8 with SMTP id b145-20020a811b97000000b002db640f49d8mr13021154ywb.326.1658821090210; Tue, 26 Jul 2022 00:38:10 -0700 (PDT) Date: Tue, 26 Jul 2022 00:37:39 -0700 In-Reply-To: <20220726073750.3219117-1-kaleshsingh@google.com> Message-Id: <20220726073750.3219117-7-kaleshsingh@google.com> Mime-Version: 1.0 References: <20220726073750.3219117-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [PATCH v6 06/17] arm64: stacktrace: Add description of stacktrace/common.h From: Kalesh Singh To: maz@kernel.org, mark.rutland@arm.com, broonie@kernel.org, madvenka@linux.microsoft.com, tabba@google.com, oliver.upton@linux.dev Cc: will@kernel.org, qperret@google.com, kaleshsingh@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, andreyknvl@gmail.com, vincenzo.frascino@arm.com, mhiramat@kernel.org, ast@kernel.org, wangkefeng.wang@huawei.com, elver@google.com, keirf@google.com, yuzenghui@huawei.com, ardb@kernel.org, oupton@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, android-mm@google.com, kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220726_003811_591317_E08DF244 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. 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 Add brief description on how to use stacktrace/common.h to implement a stack unwinder. Signed-off-by: Kalesh Singh Reviewed-by: Fuad Tabba Reviewed-by: Mark Brown --- Changes in v6: - Add Fuad’s Reviewed-by tag Changes in v5: - Add short description of each required function, per Fuad and Marc arch/arm64/include/asm/stacktrace/common.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/include/asm/stacktrace/common.h b/arch/arm64/include/asm/stacktrace/common.h index 4b632141d91c..45474b383630 100644 --- a/arch/arm64/include/asm/stacktrace/common.h +++ b/arch/arm64/include/asm/stacktrace/common.h @@ -2,6 +2,21 @@ /* * Common arm64 stack unwinder code. * + * To implement a new arm64 stack unwinder: + * 1) Include this header + * + * 2) Provide implementations for the following functions: + * on_overflow_stack(): Returns true if SP is on the overflow + * stack. + * on_accessible_stack(): Returns true is SP is on any accessible + * stack. + * unwind_next(): Performs validation checks on the frame + * pointer, and transitions unwind_state + * to the next frame. + * + * See: arch/arm64/include/asm/stacktrace.h for reference + * implementations. + * * Copyright (C) 2012 ARM Ltd. */ #ifndef __ASM_STACKTRACE_COMMON_H