From nobody Sun Feb 8 09:37:28 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 881BC3D9045 for ; Wed, 4 Feb 2026 12:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770206580; cv=none; b=BHsn/pe70oXrEInFAmRxpl11j58F26mzSIDAjoQ4ieIv4DLi6tyi9gCJpqE5/hyh232B5Sndq8N0GCNbwEddItLuvqhGTjxNGVfhfyKXGlN3rHPEDkj4ZVvDQSAuyamVg8GW0JgcTPmDM9fqgr6Qf6GCow18q0iS859EkMjIEik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770206580; c=relaxed/simple; bh=Gi+9hEGRHvFv9Hd7x5UyRCUjOA/ngvvn/zvmlDeCEYs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Hv3VoKuT4JPizqVFA8DgmBS7+91otNIyHgr8h7IZNyr40GmmtquLu2dmWPLJZ7JBeWAZ9fSspVVA3v6++TGjLRDDlvzQzMIsyDn+iZQ0cfx8N4Fe2cH0K05r8TFc0esS3GO6VVnmSjEt53+8iFgdwKQ4J4nOQG/xDC4q9qes2oo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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 C06E6339; Wed, 4 Feb 2026 04:02:52 -0800 (PST) Received: from e134344.cambridge.arm.com (e134344.arm.com [10.1.196.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B4D233F632; Wed, 4 Feb 2026 04:02:57 -0800 (PST) From: Ben Horgan To: linux-kernel@vger.kernel.org Cc: tony.luck@intel.com, reinette.chatre@intel.com, Dave.Martin@arm.com, james.morse@arm.com, babu.moger@amd.com, bp@alien8.de, Ben Horgan Subject: [PATCH v3] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry Date: Wed, 4 Feb 2026 12:02:48 +0000 Message-ID: <20260204120248.656646-1-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring = modes") introduced CONFIG_RESCTRL_ASSIGN_FIXED but left adding the Kconfig entry until it was necessary. CONFIG_RESCTRL_ASSIGN_FIXED is a resctrl fs Kconfig option so handle attempts to modify counter assignment mode when it is enabled in resctrl fs rather than delegating to arch specific code. Signed-off-by: Ben Horgan --- Changes since v1: Update the commit message to make it clear this is an anticipated follow on patch rather than a fix. Only fail attempts to change to a different counter assignment mode. Kconfig indenting. Use "counter assignment mode" text throughout. Changes since v2: Start user message with a capital Make summary more succint - was "fs/resctrl: Add missing kconfig entry for CONFIG_RESCTRL_ASSIGN_FIXED" Tidy changelog --- fs/resctrl/Kconfig | 9 +++++++++ fs/resctrl/monitor.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/fs/resctrl/Kconfig b/fs/resctrl/Kconfig index 21671301bd8a..d833dea81aea 100644 --- a/fs/resctrl/Kconfig +++ b/fs/resctrl/Kconfig @@ -37,3 +37,12 @@ config RESCTRL_RMID_DEPENDS_ON_CLOSID Enabled by the architecture when the RMID values depend on the CLOSID. This causes the CLOSID allocator to search for CLOSID with clean RMID. + +config RESCTRL_ASSIGN_FIXED + bool + depends on RESCTRL_FS + help + Enabled by the architecture when the counter assignment mode is not + configurable. This ensures that counter assignment mode is not + advertised as configurable and attempts to change counter assignment + mode fail. diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index 572a9925bd6c..4e9f55ee3267 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_= open_file *of, char *buf, } =20 if (enable !=3D resctrl_arch_mbm_cntr_assign_enabled(r)) { + if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) { + ret =3D -EINVAL; + rdt_last_cmd_puts("Counter assignment mode is not configurable\n"); + goto out_unlock; + } + ret =3D resctrl_arch_mbm_cntr_assign_set(r, enable); if (ret) goto out_unlock; --=20 2.43.0