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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61501C433EF for ; Fri, 12 Nov 2021 17:44:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FBD8604DB for ; Fri, 12 Nov 2021 17:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235518AbhKLRrH (ORCPT ); Fri, 12 Nov 2021 12:47:07 -0500 Received: from foss.arm.com ([217.140.110.172]:42522 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235122AbhKLRrF (ORCPT ); Fri, 12 Nov 2021 12:47:05 -0500 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 71C45D6E; Fri, 12 Nov 2021 09:44:14 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.58.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA14B3F718; Fri, 12 Nov 2021 09:44:11 -0800 (PST) Date: Fri, 12 Nov 2021 17:44:05 +0000 From: Mark Rutland To: madvenka@linux.microsoft.com Cc: 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, peterz@infradead.org Subject: Re: [PATCH v10 01/11] arm64: Select STACKTRACE in arch/arm64/Kconfig Message-ID: <20211112174405.GA5977@C02TD0UTHF1T.local> References: <20211015025847.17694-1-madvenka@linux.microsoft.com> <20211015025847.17694-2-madvenka@linux.microsoft.com> <20211022180243.GL86184@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211022180243.GL86184@C02TD0UTHF1T.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 22, 2021 at 07:02:43PM +0100, Mark Rutland wrote: > On Thu, Oct 14, 2021 at 09:58:37PM -0500, madvenka@linux.microsoft.com wrote: > > From: "Madhavan T. Venkataraman" > > > > Currently, there are multiple functions in ARM64 code that walk the > > stack using start_backtrace() and unwind_frame() or start_backtrace() > > and walk_stackframe(). They should all be converted to use > > arch_stack_walk(). This makes maintenance easier. > > > > To do that, arch_stack_walk() must always be defined. arch_stack_walk() > > is within #ifdef CONFIG_STACKTRACE. So, select STACKTRACE in > > arch/arm64/Kconfig. > > I'd prefer if we could decouple ARCH_STACKWALK from STACKTRACE, so that > we don't have to expose /proc/*/stack unconditionally, which Peter > Zijlstra has a patch for: > > https://lore.kernel.org/lkml/20211022152104.356586621@infradead.org/ > > ... but regardless the rest of the series looks pretty good, so I'll go > review that, and we can figure out how to queue the bits and pieces in > the right order. FWIW, it looks like the direction of travel there is not go and unify the various arch unwinders, but I would like to not depend on STACKTRACE. Regardless, the initial arch_stack_walk() cleanup patches all look good, so I reckon we should try to get those out of the way and queue those for arm64 soon even if we need some more back-and-forth over the later part of the series. With that in mind, I've picked up Peter's patch decoupling ARCH_STACKWALK from STACKTRACE, and rebased the initial patches from this series atop. Since there's some subtltety in a few cases (and this was easy to miss while reviewing), I've expanded the commit messages with additional rationale as to why each transformation is safe. I've pushed that to: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/stacktrace/arch-stack-walk There's a dependency on: https://lore.kernel.org/r/20211029162245.39761-1-mark.rutland@arm.com ... which was queued for v5.16-rc1, but got dropped due to a conflict, and I'm expecting it to be re-queued as a fix for v5.16-rc2 shortly after v5.16-rc1 is tagged. Hopefully that means we have a table base by v5.16-rc2. I'll send the preparatory series as I've prepared it shortly after v5.16-rc1 so that people can shout if I've messed something up. Hopefully it's easy enough to use that as a base for the more involved rework later in this series. Thanks, Mark. > Thanks, > Mark. > > > > > Signed-off-by: Madhavan T. Venkataraman > > --- > > arch/arm64/Kconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index fdcd54d39c1e..bfb0ce60d820 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -35,6 +35,7 @@ config ARM64 > > select ARCH_HAS_SET_DIRECT_MAP > > select ARCH_HAS_SET_MEMORY > > select ARCH_STACKWALK > > + select STACKTRACE > > select ARCH_HAS_STRICT_KERNEL_RWX > > select ARCH_HAS_STRICT_MODULE_RWX > > select ARCH_HAS_SYNC_DMA_FOR_DEVICE > > -- > > 2.25.1 > > 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C692C433F5 for ; Fri, 12 Nov 2021 17:45:39 +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 C0BD3604DB for ; Fri, 12 Nov 2021 17:45:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C0BD3604DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=/Ah6Ab3mugSI3u37UJcNMhpyJqU5KkZYlyI9KUxtaL0=; b=yu6t92DmGtpC1G FAIXZN2FJfXmsyuuGxq5m2GRCu0Lg8VJOylQySOkLG5pZTixMVv+oiLrDUsbYvh0C8M8eNqngzMRs LBPTSzI/LexnRuogkCyqfKyhMEQs7DaFe0nSZnSWyfEEPFuFDcRWn3/xSvaVaNlaIOMnfMZNIS2IO A5LWF4dZDbmTLe3tThNBvclAK5lSqTxf/PVLfS6olH5Mw3giYSX5M2ZD5xPEOSlvMRJuuvU5G262m mKTgl08zQ3pedlTChxUgC0EhUF3SIzCE5I8JtCm/m4p2y/ya6sB5ipJTmb2oPKerhsCd1a4dZCsQ4 3LYsuylss8vC/2dOFi0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlab7-00BLDX-PO; Fri, 12 Nov 2021 17:44:21 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlab4-00BLCD-7c for linux-arm-kernel@lists.infradead.org; Fri, 12 Nov 2021 17:44:20 +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 71C45D6E; Fri, 12 Nov 2021 09:44:14 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.58.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA14B3F718; Fri, 12 Nov 2021 09:44:11 -0800 (PST) Date: Fri, 12 Nov 2021 17:44:05 +0000 From: Mark Rutland To: madvenka@linux.microsoft.com Cc: 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, peterz@infradead.org Subject: Re: [PATCH v10 01/11] arm64: Select STACKTRACE in arch/arm64/Kconfig Message-ID: <20211112174405.GA5977@C02TD0UTHF1T.local> References: <20211015025847.17694-1-madvenka@linux.microsoft.com> <20211015025847.17694-2-madvenka@linux.microsoft.com> <20211022180243.GL86184@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211022180243.GL86184@C02TD0UTHF1T.local> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211112_094418_414811_6848E293 X-CRM114-Status: GOOD ( 29.27 ) 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 On Fri, Oct 22, 2021 at 07:02:43PM +0100, Mark Rutland wrote: > On Thu, Oct 14, 2021 at 09:58:37PM -0500, madvenka@linux.microsoft.com wrote: > > From: "Madhavan T. Venkataraman" > > > > Currently, there are multiple functions in ARM64 code that walk the > > stack using start_backtrace() and unwind_frame() or start_backtrace() > > and walk_stackframe(). They should all be converted to use > > arch_stack_walk(). This makes maintenance easier. > > > > To do that, arch_stack_walk() must always be defined. arch_stack_walk() > > is within #ifdef CONFIG_STACKTRACE. So, select STACKTRACE in > > arch/arm64/Kconfig. > > I'd prefer if we could decouple ARCH_STACKWALK from STACKTRACE, so that > we don't have to expose /proc/*/stack unconditionally, which Peter > Zijlstra has a patch for: > > https://lore.kernel.org/lkml/20211022152104.356586621@infradead.org/ > > ... but regardless the rest of the series looks pretty good, so I'll go > review that, and we can figure out how to queue the bits and pieces in > the right order. FWIW, it looks like the direction of travel there is not go and unify the various arch unwinders, but I would like to not depend on STACKTRACE. Regardless, the initial arch_stack_walk() cleanup patches all look good, so I reckon we should try to get those out of the way and queue those for arm64 soon even if we need some more back-and-forth over the later part of the series. With that in mind, I've picked up Peter's patch decoupling ARCH_STACKWALK from STACKTRACE, and rebased the initial patches from this series atop. Since there's some subtltety in a few cases (and this was easy to miss while reviewing), I've expanded the commit messages with additional rationale as to why each transformation is safe. I've pushed that to: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/stacktrace/arch-stack-walk There's a dependency on: https://lore.kernel.org/r/20211029162245.39761-1-mark.rutland@arm.com ... which was queued for v5.16-rc1, but got dropped due to a conflict, and I'm expecting it to be re-queued as a fix for v5.16-rc2 shortly after v5.16-rc1 is tagged. Hopefully that means we have a table base by v5.16-rc2. I'll send the preparatory series as I've prepared it shortly after v5.16-rc1 so that people can shout if I've messed something up. Hopefully it's easy enough to use that as a base for the more involved rework later in this series. Thanks, Mark. > Thanks, > Mark. > > > > > Signed-off-by: Madhavan T. Venkataraman > > --- > > arch/arm64/Kconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index fdcd54d39c1e..bfb0ce60d820 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -35,6 +35,7 @@ config ARM64 > > select ARCH_HAS_SET_DIRECT_MAP > > select ARCH_HAS_SET_MEMORY > > select ARCH_STACKWALK > > + select STACKTRACE > > select ARCH_HAS_STRICT_KERNEL_RWX > > select ARCH_HAS_STRICT_MODULE_RWX > > select ARCH_HAS_SYNC_DMA_FOR_DEVICE > > -- > > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel