From nobody Sun Feb 8 18:08:49 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D364B22E3F0 for ; Wed, 4 Feb 2026 16:20:05 +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=1770222006; cv=none; b=BNAzwJ6HG9VH2kww3itkYe+XIwaWEcv1lIMgOz4+fqVdPlxwwsrS9u72Osm9EgLa9vc3xyqtzaopnEouMQkW6k91w7r03yo2UKaIZvfERKEdHWDJwnsQbBsR6sIfV44rhKH9hEbH2s0L8t4XyL8+FlsDr/0RZ/rU3cBszrfJeiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770222006; c=relaxed/simple; bh=KmrxrgBzoHezE8m9/UZUj1RGol3g/siZWf45Knn/jVE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=U/gnW7qL64itUhB/gNLvwZgB9DVOxRsYYs48Ppuego1ImKmCN6aMO+2HmUzq12ue+qT5X/hRyB7Spy5sU8lFrIJdQYjHJVARDciwNZ7e74zpFIPGqoSdsEtbV6p70omaewUM9iFg6LjEU7TTQuFuW2th2Mgs1dSYrky8Yj7lRB0= 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 C2823339; Wed, 4 Feb 2026 08:19:58 -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 B46653F73F; Wed, 4 Feb 2026 08:20:03 -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 v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry Date: Wed, 4 Feb 2026 16:19:52 +0000 Message-ID: <20260204161952.685921-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. Add CONFIG_RESCTRL_ASSIGN_FIXED in order to support MPAM where the counter assignment mode is indeed fixed. 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 Reviewed-by: Reinette Chatre --- 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 succinct - was "fs/resctrl: Add missing kconfig entry for CONFIG_RESCTRL_ASSIGN_FIXED" Tidy changelog Changes since v3: Add middle paragraph in 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