From patchwork Sun Nov 19 16:57:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 13460544 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 2F272C54FB9 for ; Sun, 19 Nov 2023 16:58:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD85D6B0372; Sun, 19 Nov 2023 11:58:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B8A4B6B0376; Sun, 19 Nov 2023 11:58:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2ACD6B0378; Sun, 19 Nov 2023 11:58:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 91D806B0372 for ; Sun, 19 Nov 2023 11:58:50 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6CD9AB54C4 for ; Sun, 19 Nov 2023 16:58:50 +0000 (UTC) X-FDA: 81475313220.01.C21F0BB Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf01.hostedemail.com (Postfix) with ESMTP id BAF7640010 for ; Sun, 19 Nov 2023 16:58:48 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of alexandru.elisei@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=alexandru.elisei@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700413128; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R6I1c5rbbPFrcDIQ/5SdurlXhms/24xZXj3vUv0XSJo=; b=cL2nb3nIDYpEfQrtPyhsKpdzrDjXXiWtTU57sITmLPvD6itnxAx08drdKlksTmltdC1PrZ f1o12yLdLElqkFayh3/JrMlLcuCklf+5PsKt5e0iOpk7Q87pIDX4sCFZ40i9/C/JO4zY9X cgeEjsyX9nSjBG75k2r8z5uPOuUkRC8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700413128; a=rsa-sha256; cv=none; b=jKdgGbYLPdRPeCMiRO4QRM6h0IOi4TSmk+8f2sgFgDyBw0ENDdr2FwNQtr4XSMmi9JxDUG 6dMPW6LDNZksP2s7qvHU7uyraiZ171+A8MOq8JztlukrtJF0uJjjST/l/mjXt+4pJbeerv ZZpcssZa4uG1bFhNFm4TYcHaKkcWx6I= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of alexandru.elisei@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=alexandru.elisei@arm.com; dmarc=pass (policy=none) header.from=arm.com 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 528181477; Sun, 19 Nov 2023 08:59:34 -0800 (PST) Received: from e121798.cable.virginm.net (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2807D3F6C4; Sun, 19 Nov 2023 08:58:43 -0800 (PST) From: Alexandru Elisei To: 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 Cc: pcc@google.com, steven.price@arm.com, anshuman.khandual@arm.com, vincenzo.frascino@arm.com, david@redhat.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: [PATCH RFC v2 13/27] arm64: mte: Make tag storage depend on ARCH_KEEP_MEMBLOCK Date: Sun, 19 Nov 2023 16:57:07 +0000 Message-Id: <20231119165721.9849-14-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231119165721.9849-1-alexandru.elisei@arm.com> References: <20231119165721.9849-1-alexandru.elisei@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: BAF7640010 X-Rspam-User: X-Stat-Signature: bmf3t5zxbfzhdsxkfjfbnmf557inp1r3 X-Rspamd-Server: rspam03 X-HE-Tag: 1700413128-948332 X-HE-Meta: U2FsdGVkX18GQp+GhuN9+TA2pZmKAhDaOlXTNy0AJtVyA40Wrz3PzeAD07gdsIrFn38Z26Do0sGgBWgYMnY16aVV649D7NqP8Y9lGwblNueZef/FaZ2egjUqrM1OHz01FuUd+2E6avLa1hfDSU4w8+rnVeMoeuNP9sUfIxh/cYvZ4WITIhvq1sdy/sybdSiRZf+5L0Ak1RG4bCZJ/aR273TdhpbYU6isUGH9JFwUtfAwYLgs/ccd5rVU8I4YcGAOlNFtbnMM21R2StsRkKtJORWiNjCUphnQ5CKaeHIUi54+pxcxK5dsJ84CFHCxKqNqAi9Gc7oN89nEAdH99btmgUPNwwpYqknpOUvCE4/T8RGQ9dLL6u5+DIRCsjF/PacXwk/dfanGahS/aRB3IxmmUvoMDhstiRy+6sCFCbjVkahHqI2mr5pHx8ffIKUFL5n1R7fhaxHiSBPI9158rfgWwwWJjJWa7OUwLRz0dVPRAshyvsiqRovLw7OxgTVR/P3lYi2Ks8npaxRo33YfT+RwGKGJMwuITxM2W5yIqUxFi3jT5Ot873iEK3Whp6TBPwg+h7UnN6rrvdNrw6J3lWdSdTJMjcze7FkGGLQIs39dv5yvjZ5vdGJ6ttZtBGdTdJ/2O/d0YJXs5bY1bGnGB3nTKeYYEjYY+W84uUIxHCUaS6E988Oz8PM4RksU8bMq0w7fRtBMoJ7zNa4GfdS3HvDuy/QNYPUat/PSmmMKRELqpDyvkfsNbpDSBfxlb7ZONWre6Ci9vyof7q1Jlsrf79fqFScCAW1PVNqI6OIYSZwd2Yo9hPKfmqxY/9CM2FLdk7SX4AIo/is1syoDz+Z3I5o7cEuQYxIDqoEYdvRb+lQK1J9jORH3QJqjdLmDNpbsKMtPbP0cuceemmDnGwezfX+xieS7/baAyMWmzsizWpyLg4xnCPZBQh1TFGfQmQZFc5eqwbIergjkAt/dhwKxbsd aPu+hQW3 97IDteMin2VSErCDydJ59rmy5eWgn92eYUtPk2W4xuJ0ewBODeqStMShFqbjtr4H7uQVKmrHVQzWhtkSR8iNOd+ux7fEzksNF8OgjTYcoHfKH2FlA/1s4lfQwYenMS4n4ZIVvLddk6jyiK09fuxDThYWoLMPCZa0cLN8EZVC+4bHzHBrj8+53MuD5qZghogxyEw9WxXpPKICzVrg= 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: 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