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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EF46C4167B for ; Wed, 29 Nov 2023 10:46:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A09296B03C7; Wed, 29 Nov 2023 05:46:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9DF056B03C8; Wed, 29 Nov 2023 05:46:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8CEB46B03C9; Wed, 29 Nov 2023 05:46:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7E0C26B03C7 for ; Wed, 29 Nov 2023 05:46:16 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 609F1A0533 for ; Wed, 29 Nov 2023 10:46:16 +0000 (UTC) X-FDA: 81510662352.02.68086F7 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf30.hostedemail.com (Postfix) with ESMTP id A419080003 for ; Wed, 29 Nov 2023 10:46:14 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf30.hostedemail.com: domain of alexandru.elisei@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=alexandru.elisei@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701254774; a=rsa-sha256; cv=none; b=doJtgrT2m7XlOJdySujf4z9Om+dQeVnsAhJ3gQV+Ct3immy5fgFFXeKqVwOsMhoA/GPu6c Fv6sk5Hjoxp1gwLHag0+ST/KNhEqsKvkn0c39fbMf3mFkVyXzUF0+kOxKX+JvCP7yqpVDZ cZfCLyOmZUNQMVzFimNzHZXsrKWrEg0= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf30.hostedemail.com: domain of alexandru.elisei@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=alexandru.elisei@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701254774; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5PANKAJZhsDZDJET1c859gfpZ1jk9qBodZQqZ7NU5Hs=; b=bJYYzPm1INvYoBs4bVhS7nQP9KBjS8jxw3KYq8UdpBJDo8T1kzxR4szPRrM0W3XTfQNFq8 2h6atsQ6jqWyf/bj/zXArNVpqDxiwa3F78FwX7V4AxAapjPlSzZfSoJ6WTHYoMunJOvrm6 bUPRnUlMjZqjE0o57KBDTKO+0P9mfNw= 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 EEA3E2F4; Wed, 29 Nov 2023 02:47:00 -0800 (PST) Received: from raptor (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 857663F5A1; Wed, 29 Nov 2023 02:46:08 -0800 (PST) Date: Wed, 29 Nov 2023 10:46:05 +0000 From: Alexandru Elisei To: David Hildenbrand Cc: catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, arnd@arndb.de, akpm@linux-foundation.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, mhiramat@kernel.org, rppt@kernel.org, hughd@google.com, pcc@google.com, steven.price@arm.com, anshuman.khandual@arm.com, vincenzo.frascino@arm.com, eugenis@google.com, kcc@google.com, hyesoo.yu@samsung.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH RFC v2 13/27] arm64: mte: Make tag storage depend on ARCH_KEEP_MEMBLOCK Message-ID: References: <20231119165721.9849-1-alexandru.elisei@arm.com> <20231119165721.9849-14-alexandru.elisei@arm.com> <91c5d2e2-57b1-4172-88e0-cd07a8d85af4@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A419080003 X-Stat-Signature: 9sni11m7x3n5d4ygm1e17tz7i5d6deym X-Rspam-User: X-HE-Tag: 1701254774-469572 X-HE-Meta: U2FsdGVkX18yjxCnSUAOBRAj/CbS9cW1zcxM4tbehuxr7Y197/kryk3qSp/M/xUYKcwC4ZokAtVi4o+NZkRLF8O0lAyBTkvGCmQQnadgU0Luhu9y8y+awJn7DBsPEz4P3qFLm5GPpKUXWqFjcFJr0kL9sS++1fA+OdFZ3ooZEy1xm2h4XEWfAmypXIZogDslcs7JB7gf67UZl1uqgztwaNin5ueItEya+4c97Dsfhcr15IMXnRcx/gmZ+k5hv8ofxGp7jAsxrse2J/pVUc8INEIuKQqhf6UuOUhuKTxYR02CXEe+a/8KpoNAV88Ldoz3wwAWEzXCyt50hun5PBLdqXik9UowRjcGy1rKYZE+hHW9inw61qHmD+LFaGLcy6zD8LuM/pRUEs8Yfn1LfBF1hUH2SApTrQQiMeQ68rnJh3MKaxYLGCOg/CqTt6c9Yvyy8Iz5qbpv/zslNGsuwFIpi/kASnoXs+Difg5iuIdGxB2+StPplb3mEG1PDPFMRb9NEQht+7TP99dfap/TDlio4fRRlPLvXEdiTEjmVtWp/jkC9qQTw2bLIFaFWfwfetH2j5/KQMEbSM181lE1tR8PqCsRcx17oFr6OSmxpT1tT9BMwOsbBN7RFJ/UdLaa7q72z2Bv+DaKvQ4xKQ5IR2vx0ng/uhRklFubWKb+VuOfMEWLzQ/sEopu7XAIadW1rx3snYyTZsEV/IyGBlhN5CI6JZuF6zPAmGn1gnPgBzAJWr/BSYyX1i0Yy0XNlZkKFikS9WImMHDzXiv5HNExz6RowuU2mG3T9MLiIhzVe5VWmr14ATnO8VS6cd6a54Jb9vfJhuJ1CVUTQzABXNWsHj9AoJMVzQzfjXsP2N2OMjfCMw3W1GGgs8T+13xbRGkLZFRf5Z5oJLDbijeDR0/rGKziW6Nvsbx7JhGkRWpMIGNL3PmBwqbKuzzxAhc/BfnZvo9scw6jSADf8pd5NXRH1c2 7kI1p1/X qe6Eybb57DXPAwby19Qx5FqPlnr2M+8ZbiAIsGWyFtQoXYYxtGJOTtIosFpQKmXvk4bGHWrNNG0Xr9gcbY5dLEybOMHaprDoEFKlWT9zYBT9TfysEA65LlQJcjooGTFLwmHTYymXkCDhVPJJiOAfP5e3rlrOFtr5N3HuYhh/M+8hiZFt4b/BQ0IDZyoL5DZyPqjFkuC3fkmA0mSCVn+loqboXdw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi, On Tue, Nov 28, 2023 at 06:05:20PM +0100, David Hildenbrand wrote: > On 27.11.23 16:04, Alexandru Elisei wrote: > > Hi, > > > > On Fri, Nov 24, 2023 at 08:51:38PM +0100, David Hildenbrand wrote: > > > On 19.11.23 17:57, Alexandru Elisei wrote: > > > > Tag storage memory requires that the tag storage pages used for data are > > > > always migratable when they need to be repurposed to store tags. > > > > > > > > If ARCH_KEEP_MEMBLOCK is enabled, kexec will scan all non-reserved > > > > memblocks to find a suitable location for copying the kernel image. The > > > > kernel image, once loaded, cannot be moved to another location in physical > > > > memory. The initialization code for the tag storage reserves the memblocks > > > > for the tag storage pages, which means kexec will not use them, and the tag > > > > storage pages can be migrated at any time, which is the desired behaviour. > > > > > > > > However, if ARCH_KEEP_MEMBLOCK is not selected, kexec will not skip a > > > > region unless the memory resource has the IORESOURCE_SYSRAM_DRIVER_MANAGED > > > > flag, which isn't currently set by the tag storage initialization code. > > > > > > > > Make ARM64_MTE_TAG_STORAGE depend on ARCH_KEEP_MEMBLOCK to make it explicit > > > > that that the Kconfig option required for it to work correctly. > > > > > > > > Signed-off-by: Alexandru Elisei > > > > --- > > > > arch/arm64/Kconfig | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > > > index 047487046e8f..efa5b7958169 100644 > > > > --- a/arch/arm64/Kconfig > > > > +++ b/arch/arm64/Kconfig > > > > @@ -2065,6 +2065,7 @@ config ARM64_MTE > > > > if ARM64_MTE > > > > config ARM64_MTE_TAG_STORAGE > > > > bool "Dynamic MTE tag storage management" > > > > + depends on ARCH_KEEP_MEMBLOCK > > > > select CONFIG_CMA > > > > help > > > > Adds support for dynamic management of the memory used by the hardware > > > > > > Doesn't arm64 select that unconditionally? Why is this required then? > > > > I've added this patch to make the dependancy explicit. If, in the future, arm64 > > stops selecting ARCH_KEEP_MEMBLOCK, I thinkg it would be very easy to miss the > > fact that tag storage depends on it. So this patch is not required per-se, it's > > there to document the dependancy. > > I see. Could you add some static_assert / BUILD_BUG_ON instead? I can do that, sure. Thanks, Alex > > I suspect there are plenty other (undocumented) reasons why > ARCH_KEEP_MEMBLOCK has to be enabled for now, and none sets > ARCH_KEEP_MEMBLOCK, I suspect/ > > -- > Cheers, > > David / dhildenb >