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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 ACF82C433DB for ; Fri, 19 Mar 2021 17:42:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 3F7B26197B for ; Fri, 19 Mar 2021 17:42:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F7B26197B 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=mSgeM+AZhXL51e43X7M763PzA/0adIVCT52HtTmhaMw=; b=To+vgzqVNqLBFD7Yj45zwJbTKG /gEMSQFYmqlHrYYakMozdCxGJFJY2onH1h/AQum+b8pRUd3ecDrBtW8iqF3c7yPs8lfXuNZeaky24 dQ6aa/S77J9J7KZye/l08ajknFPmvDVb7NMIQD0X1/+8o71y//6dOj4IMLkF40cfGPltqow1G8wLH oTWtGOY7R5aLNBdbw2SJtUVUTq64tiAFkZbrQK5hw2yw9GALBBXK+d/2VGmhNUMO2sKlSP12sT+Y7 /uetA6YcCyBwlihb4B/gqFxl1xvxIB3JnLO+B4z7qcz8r7zX1PSwPCeN/MHVmTNKErZwOKVRBa9VT 04QtNibA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNJ6w-007ro8-9R; Fri, 19 Mar 2021 17:40:35 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNJ6q-007rnN-U6 for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 17:40:30 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D8CB6197B; Fri, 19 Mar 2021 17:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616175627; bh=3oFZzo7MnK6jzG4jtWMX6Z9yJ7zIydNWCu+2tleyCoE=; h=From:To:Cc:Subject:Date:From; b=TVp6UBSgvuT2Su1iWl1i8Y6NltPlLLM9gX+IAguKRCqlj8qdK0WB54c7eG0+r2OpW eGtXw+RcQOU34pu9Y9oISOSxmBDjOxQZmxxRpgaq8MtRbUpyPhor7xL7XhNMgtDkhk 2ckrp0346XqNZB0Qh3KLOpoDnyAN0SS9iZBwEMUh0gG4/ngB05nbTvZWP2vmL0gwpt VFloveLK0OgzIkCPdqgUg+KY+6p8zpbLluj3m6fDESVBKucB8U4msXLnIShdhliQAk 71c8B6OZc9N2xKX+lrBdRFnIZ8OmreszwtT8Vc6gXhEGkcVabHv3DyRrg4oYyHAFP8 pv9Ksu1JEEuQA== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH] arm64: stacktrace: Move start_backtrace() out of the header Date: Fri, 19 Mar 2021 17:40:22 +0000 Message-Id: <20210319174022.33051-1-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=BAUOlYWIluhp8odUSFl40KOCknoMiPDuP2ZvxhLLXLg=; m=/ZMh06k9anHSpsTS871mmhPFAgs4KAS+KLj+JzKb6lM=; p=OMyo7Xhw/SKdFY7YIFZe86oPJqhUVHzOG7At9kjMD2s=; g=a402226d0b1500b4997aa0647ed547a7516224ee X-Patch-Sig: m=pgp; i=broonie@kernel.org; s=0xC3F436CA30F5D8EB; b=iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmBU4UQACgkQJNaLcl1Uh9Byygf6AsZ 4KpwRzxkz8z6jubDK9xOKeKXZkUQWtWMVlMFQbI9y7y4dElm2PVUhF50ovKjX5NnkSuhpxJTKMMaJ YcTzJZ0jfKmELGsX7zhMeKLgI+44Pi5p0pd7blJ9kDU2AkxdjAJOwxTPmkllgBj872Pc+RKUKHkeV v7HwKFBi42mKQhkfhHM2oB4mIQ4iK5ErDZjlItTc6EgrMHLX9TDuzfT+gJ/GHr4pjb0jtPSVBTD/U jX6waXD0L5+5xcC+b0wNVndlqERQoF1b8loeIZYuIQWAvSSh0ghAd3PvWuCuuZD+TiOl9q0u18xFS DXuW2gKUKBls7vvzfv79tokkjOu00dg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_174029_321032_597357D8 X-CRM114-Status: GOOD ( 16.17 ) 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: , 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 start_backtrace() is a static inline function in the header. Since it really shouldn't be sufficiently performance critical that we actually need to have it inlined move it into a C file, this will save anyone else scratching their head about why it is defined in the header. As far as I can see it's only there because it was factored out of the various callers. Signed-off-by: Mark Brown --- arch/arm64/include/asm/stacktrace.h | 24 ++---------------------- arch/arm64/kernel/stacktrace.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h index eb29b1fe8255..4b33ca620679 100644 --- a/arch/arm64/include/asm/stacktrace.h +++ b/arch/arm64/include/asm/stacktrace.h @@ -148,27 +148,7 @@ static inline bool on_accessible_stack(const struct task_struct *tsk, return false; } -static inline void start_backtrace(struct stackframe *frame, - unsigned long fp, unsigned long pc) -{ - frame->fp = fp; - frame->pc = pc; -#ifdef CONFIG_FUNCTION_GRAPH_TRACER - frame->graph = 0; -#endif - - /* - * Prime the first unwind. - * - * In unwind_frame() we'll check that the FP points to a valid stack, - * which can't be STACK_TYPE_UNKNOWN, and the first unwind will be - * treated as a transition to whichever stack that happens to be. The - * prev_fp value won't be used, but we set it to 0 such that it is - * definitely not an accessible stack address. - */ - bitmap_zero(frame->stacks_done, __NR_STACK_TYPES); - frame->prev_fp = 0; - frame->prev_type = STACK_TYPE_UNKNOWN; -} +void start_backtrace(struct stackframe *frame, unsigned long fp, + unsigned long pc); #endif /* __ASM_STACKTRACE_H */ diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 7337506d6a7f..4c889bd098af 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c @@ -35,6 +35,30 @@ * add sp, sp, #0x10 */ + +void start_backtrace(struct stackframe *frame, unsigned long fp, + unsigned long pc) +{ + frame->fp = fp; + frame->pc = pc; +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + frame->graph = 0; +#endif + + /* + * Prime the first unwind. + * + * In unwind_frame() we'll check that the FP points to a valid stack, + * which can't be STACK_TYPE_UNKNOWN, and the first unwind will be + * treated as a transition to whichever stack that happens to be. The + * prev_fp value won't be used, but we set it to 0 such that it is + * definitely not an accessible stack address. + */ + bitmap_zero(frame->stacks_done, __NR_STACK_TYPES); + frame->prev_fp = 0; + frame->prev_type = STACK_TYPE_UNKNOWN; +} + /* * Unwind from one frame record (A) to the next frame record (B). * -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel