From patchwork Fri Oct 15 02:58:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhavan T. Venkataraman" X-Patchwork-Id: 12559779 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91759C433EF for ; Fri, 15 Oct 2021 03:01:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 561A760F70 for ; Fri, 15 Oct 2021 03:01:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 561A760F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/5Pd5Fu0lPvs7ZJrg+IJ9l0Tme2dCfW18kT5HsslmBc=; b=CxiWYrrQvaEM0C QLNxkYWTrBFUIXENvR9H79wC6hg2Vv7IIU+Y9KNVQroOA52y4FzVJilLE0poL6/w+KRf6US1Wie9G NiUcwmHazRy1oxKlCxZCKGB5tSqE8EsAQzuDzp3JBIKj8k5mkFIAHaeC7LOmvPeLl8inK/SlNp1hN AVzbJVLDX7NbTeLIGKplEtnts+yvCWD9e7khQw9Aw0dC8pt6Q8kwOIwNvLgu86NF8bdGZ0p6QaugM 6x5S5gmd+BkGccH3lEYwtpu1FQXturbAFtLw5zlklYP5skx98wQLNi6KkIoNDIQ0JObW70NLr38zF uQuNr1zTNSOwY/Z9NWoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbDS3-005Chy-ME; Fri, 15 Oct 2021 03:00:08 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbDR5-005CPJ-OC for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 02:59:09 +0000 Received: from x64host.home (unknown [47.187.212.181]) by linux.microsoft.com (Postfix) with ESMTPSA id A17CB20B9D1B; Thu, 14 Oct 2021 19:59:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A17CB20B9D1B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1634266747; bh=qZScEFTO+pORG9YKmb/gJbPlBbD1pvru4NrU3/YAom4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rPpgRKWUELiCUlbT2/dx49F7xcW9p9l+Za9LZzDNLMvzJEcbk0EeVKtezPjgNJLzr uiY+JaeTzLDStTr7NfSJEnbLbAWhNVe828yr39wk4OgkaL3jFjYPNiLarXbBKVasgt xfsH/Ct60z928Bo+HOmcLdEDKDxpgIugmBs/kSf4= From: madvenka@linux.microsoft.com To: mark.rutland@arm.com, broonie@kernel.org, jpoimboe@redhat.com, ardb@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, madvenka@linux.microsoft.com Subject: [PATCH v10 04/11] arm64: Make return_address() use arch_stack_walk() Date: Thu, 14 Oct 2021 21:58:40 -0500 Message-Id: <20211015025847.17694-5-madvenka@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015025847.17694-1-madvenka@linux.microsoft.com> References: <20211015025847.17694-1-madvenka@linux.microsoft.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211014_195907_857033_62C5D31F X-CRM114-Status: UNSURE ( 8.23 ) 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 From: "Madhavan T. Venkataraman" Currently, return_address() in ARM64 code walks the stack using start_backtrace() and walk_stackframe(). Make it use arch_stack_walk() instead. This makes maintenance easier. Signed-off-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Reviewed-by: Mark Rutland Tested-by: Mark Rutland --- arch/arm64/kernel/return_address.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/arm64/kernel/return_address.c b/arch/arm64/kernel/return_address.c index a6d18755652f..92a0f4d434e4 100644 --- a/arch/arm64/kernel/return_address.c +++ b/arch/arm64/kernel/return_address.c @@ -35,15 +35,11 @@ NOKPROBE_SYMBOL(save_return_addr); void *return_address(unsigned int level) { struct return_address_data data; - struct stackframe frame; data.level = level + 2; data.addr = NULL; - start_backtrace(&frame, - (unsigned long)__builtin_frame_address(0), - (unsigned long)return_address); - walk_stackframe(current, &frame, save_return_addr, &data); + arch_stack_walk(save_return_addr, &data, current, NULL); if (!data.level) return data.addr;