From nobody Thu Apr 2 22:12:11 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CF5E41B366 for ; Thu, 26 Mar 2026 17:26:08 +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=1774545970; cv=none; b=Xd7jBN0W0vfUH1yO3xidaeiOlCazbYI67bT/aodtIvkNad2u+UBZnUho4OW9n8tQttjFWn78L0Oa5IRz6FK89tf79YmoFv+RzGq/4irRzvBbqEZWme33GATl+H2kUglyNrVMYL9X34e2B9SVdy1hW0gGyFSTZMkugL/26Th9A50= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774545970; c=relaxed/simple; bh=GHwXODuDHTkuvstiHLr9nJaIWNQHcUF6SOefsZqplbk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N7zcPYKaswSy+ie+NvuyLtU3HLOVuYt8vq1HJ4HYzO1uRxELOV4QrlqeyjUgs1617IbE5Rj1eLdTGhs2TyQjC22iRgs+gq+0nGQBCpzIDvTJ7xc3hraMh7RjYkpjMxERbbdkBbNYywxXDTOdbFF+3MSXDadLlYbEr8kPRVUO0CE= 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; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=p44CDDnA; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="p44CDDnA" 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 4453F2EC5; Thu, 26 Mar 2026 10:26:02 -0700 (PDT) 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 69B5C3F641; Thu, 26 Mar 2026 10:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1774545968; bh=GHwXODuDHTkuvstiHLr9nJaIWNQHcUF6SOefsZqplbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p44CDDnAkDVYcdT3XcF+Mvy14JERDimtPId3aNcTrF11J0ftLDFnXy7j+qORo7Lmi 5hNZ63DkSjhPqGDMn1ZXhNuBp2269OcVS7ff5Zldud58uj6rUew13ieazeVD4gvsuA PBsP9O0QMEYRuLA0kBBMGrELt0Qrs60r8tN+8Y+0= 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, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ben.horgan@arm.com, fenghuay@nvidia.com, tan.shaopeng@fujitsu.com Subject: [PATCH v4 4/7] x86,fs/resctrl: Add monitor property 'mbm_cntr_assign_fixed' Date: Thu, 26 Mar 2026 17:25:48 +0000 Message-ID: <20260326172551.1553871-5-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260326172551.1553871-1-ben.horgan@arm.com> References: <20260326172551.1553871-1-ben.horgan@arm.com> 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. The counter assignment mode is fixed in MPAM, even when there are assignable counters, and so addressing this is needed to support MPAM. To avoid the burden of another Kconfig entry, replace CONFIG_RESCTRL_ASSIGN_FIXED with a new property in 'struct resctrl_mon', 'mbm_cntr_assign_fixed'. To enable better user reporting check the new property in resctrl_mbm_assign_mode_write(). Signed-off-by: Ben Horgan --- Changes since v2: Change to a resctrl_mon property rather than a arch hook Update the commit message to mention the property --- fs/resctrl/monitor.c | 8 +++++++- include/linux/resctrl.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index 8fec3dea33c3..6afa2af26ff7 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -1454,7 +1454,7 @@ int resctrl_mbm_assign_mode_show(struct kernfs_open_f= ile *of, else seq_puts(s, "[default]\n"); =20 - if (!IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) { + if (!r->mon.mbm_cntr_assign_fixed) { if (enabled) seq_puts(s, "default\n"); else @@ -1505,6 +1505,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 (r->mon.mbm_cntr_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; diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 06e8c72e8660..a986daf5f2ef 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -294,6 +294,7 @@ enum resctrl_schema_fmt { * @mbm_assign_on_mkdir: True if counters should automatically be assigned= to MBM * events of monitor groups created via mkdir. * @mbm_cntr_configurable: True if assignable counters are configurable. + * @mbm_cntr_assign_fixed: True if the counter assignment mode is fix. */ struct resctrl_mon { u32 num_rmid; @@ -302,6 +303,7 @@ struct resctrl_mon { bool mbm_cntr_assignable; bool mbm_assign_on_mkdir; bool mbm_cntr_configurable; + bool mbm_cntr_assign_fixed; }; =20 /** --=20 2.43.0