From nobody Sun Feb 8 10:30:09 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAAF91E3DE5 for ; Wed, 28 Jan 2026 16:12:57 +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=1769616780; cv=none; b=uS/JqbM7PKDQDJB7R3zerro2uFkv42bZ6c6zoMwwD1BTDST8WQB0NlGBY+51HlNHEfQvtQienPJ1vtE4aq5z5yI4eNgA8xH2wHaTQgiJAimAEkoixFfNWKZC9EsauoDJFsHC/y1neyt29ewnU8JY+d+uyJTeoKJMOOG5GfU4ZJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616780; c=relaxed/simple; bh=n8QT+id72Mw3iz4IiMFXDLTg3Unt2zajdQ25d2jSMGA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kq+67eYpnhA/WXnRb0lNLXn/s7O3wbtvrfBVolh4mGV/aTE4UtT5tans+BdmxQfMxMS4QL3lt18RzngJgo5LDTAMP3bbjuLc4+Gh9/bnmGyhwIhqPhkLN9cbvlY8skklYFVSgO2APoBxxreYj6uUCsTUEYvvrea9P0Q5/rzoBQI= 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 47E1C1516; Wed, 28 Jan 2026 08:12:50 -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 504C83F5CA; Wed, 28 Jan 2026 08:12:55 -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 v2] fs/resctrl: Add missing kconfig entry for CONFIG_RESCTRL_ASSIGN_FIXED Date: Wed, 28 Jan 2026 16:12:45 +0000 Message-ID: <20260128161245.3085391-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" The 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. Add the kconfig entry as it is now necessary in order to support ABMC on MPAM where the counter assignment mode is indeed fixed. Also, take the opportunity ensure that a user attempt to change between different counter assignment mode fails from the resctrl code rather than delegating to the arch specific code and let the user know by adding a message in last_cmd_status. 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. --- 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..93756be50062 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