From nobody Thu Apr 16 20:49:11 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCA332D8396 for ; Wed, 25 Feb 2026 20:19:21 +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=1772050763; cv=none; b=fZ35OwGnfcJF1Io3xJbIF75WJ6pLh3WFG/0cUxvyt3kN1aQMQhv28vOZ+MkPgJUKxme3VWycQsA9NZ8T8tLFp4zDW8jFOub4YHQjzHHmRDGLYDvj02410EM3B8I1JHJxCBX9PIrTqvyIBge41dM+/EeJcn/DvXhAyYVG78EeLBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772050763; c=relaxed/simple; bh=/bIUZxUTLR2i/cpBBU8V8roQsi22X7toUebUWIaM+8A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LLdMMccpCqHUJFpKwXPKTguwj8UC1PrTQLOBVFNBp00IsU9//ZML6JXGh1nY7XcuYjeFoBtsRQGcOmboDxXwLiL4bjWxgTm/jjQ2zMp35ALUNpK87uJC5LB6gbG3p91kZf/yA00HqkGn21cDruX/c3lTIKsEu7hW+fNrsNnNtMM= 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 D858F1756; Wed, 25 Feb 2026 12:19:14 -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 0F15C3F73B; Wed, 25 Feb 2026 12:19:18 -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, 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 v1 1/4] x86,fs/resctrl: Make resctrl_arch_is_evt_configurable() aware of mbm_assign_mode Date: Wed, 25 Feb 2026 20:19:02 +0000 Message-ID: <20260225201905.3568624-2-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260225201905.3568624-1-ben.horgan@arm.com> References: <20260225201905.3568624-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" The features BMEC and ABMC provide separate interfaces to configuring which bandwidth types a counter tracks. Currently resctrl_arch_is_evt_configurable() only ever returns true if BMEC is supported. ABMC is useful even when BMEC is supported as it also provides counter assignment which reduces the number of hardware monitors a system requires. It is an architectural detail that ABMC provides counter configurability without requiring the prior feature, BMEC. On MPAM systems these two features are independent and the bandwidth types are limited to a choice of only read or write. In order to give resctrl the information to support these features independently extend resctrl_arch_is_evt_configurable() to report whether events are configurable when using the mbm_event counter assignment mode. Signed-off-by: Ben Horgan --- arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++++++-- fs/resctrl/monitor.c | 4 ++-- include/linux/resctrl.h | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 7667cf7c4e94..d35f4417d55e 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -877,11 +877,19 @@ bool rdt_cpu_has(int flag) return ret; } =20 -bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt) +bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt, bool assi= gnable) { - if (!rdt_cpu_has(X86_FEATURE_BMEC)) + if (!assignable && !rdt_cpu_has(X86_FEATURE_BMEC)) return false; =20 + if (assignable && !rdt_cpu_has(X86_FEATURE_ABMC)) + return false; + + /* + * When ABMC is used the mbm_local and mbm_total events are enabled + * based on the equivalently named cpu features. (In order to allow + * fallback to the default counter assignment mode). + */ switch (evt) { case QOS_L3_MBM_TOTAL_EVENT_ID: return rdt_cpu_has(X86_FEATURE_CQM_MBM_TOTAL); diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index 49f3f6b846b2..d25622ee22c5 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -1854,12 +1854,12 @@ int resctrl_l3_mon_resource_init(void) if (ret) return ret; =20 - if (resctrl_arch_is_evt_configurable(QOS_L3_MBM_TOTAL_EVENT_ID)) { + if (resctrl_arch_is_evt_configurable(QOS_L3_MBM_TOTAL_EVENT_ID, false)) { mon_event_all[QOS_L3_MBM_TOTAL_EVENT_ID].configurable =3D true; resctrl_file_fflags_init("mbm_total_bytes_config", RFTYPE_MON_INFO | RFTYPE_RES_CACHE); } - if (resctrl_arch_is_evt_configurable(QOS_L3_MBM_LOCAL_EVENT_ID)) { + if (resctrl_arch_is_evt_configurable(QOS_L3_MBM_LOCAL_EVENT_ID, false)) { mon_event_all[QOS_L3_MBM_LOCAL_EVENT_ID].configurable =3D true; resctrl_file_fflags_init("mbm_local_bytes_config", RFTYPE_MON_INFO | RFTYPE_RES_CACHE); diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 006e57fd7ca5..9ac1fe76bff4 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -419,7 +419,7 @@ bool resctrl_enable_mon_event(enum resctrl_event_id eve= ntid, bool any_cpu, =20 bool resctrl_is_mon_event_enabled(enum resctrl_event_id eventid); =20 -bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt); +bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt, bool assi= gnable); =20 static inline bool resctrl_is_mbm_event(enum resctrl_event_id eventid) { --=20 2.43.0 From nobody Thu Apr 16 20:49:11 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2260A306B21 for ; Wed, 25 Feb 2026 20:19:23 +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=1772050767; cv=none; b=KGPFXp/TE/L8Ii+BA31q2fMVDnQOceOp1lYHIiYCURN8EqgGkHdq4T7GziqtfV/yim7yIThTGDLfEJdXN31Y9bO+h97jFyBCzPaJEvdBlOWI1c6jDycZDz4YHSqqPgzbi95OoznUjppg/rifIpG+/rZEl9hfFdfYdPTvvxYo5a0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772050767; c=relaxed/simple; bh=JrmCt2XWTUBODCwHeagg1gPs+v2mhjzrwujZON0gDmM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TbSNE1YNOMuIq3dWOGYpbcnLdy8dqLSVopN/sVL+XWCoMEUK8SO1gJ6aw7msf5zOxRMB08tBTEtbetWwtTsoTopoUx9DaF124L4f+APm+6bBXsTlnLoEF4G+oFLMfo7PQRIVhKJROfsDFC2iWEc59u1FDlqcTXRvi2rcOG9V4M8= 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 4E47D1650; Wed, 25 Feb 2026 12:19:17 -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 718423F73B; Wed, 25 Feb 2026 12:19:21 -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, 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 v1 2/4] fs/resctrl: Only show 'event_filter' files if events are configurable Date: Wed, 25 Feb 2026 20:19:03 +0000 Message-ID: <20260225201905.3568624-3-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260225201905.3568624-1-ben.horgan@arm.com> References: <20260225201905.3568624-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" When the counter assignment mode is mbm_event resctrl assumes the mbm events are configurable and exposes the 'event_filter' files. These files live at info/L3_MON/event_configs//event_filter and are used to display and set the event configuration. ABMC always supports event configuration but for MPAM they are independent. Decouple event configuration from counter assignment by only showing the 'event_filter' interface when event configuration is supported at the same time as 'mbm_event' counter assignment. Remove only the 'event_filter' files and not the containing directories so that their names can still be used to identify the assignable counters. Signed-off-by: Ben Horgan --- fs/resctrl/rdtgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 5da305bd36c9..e79929d84317 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -2338,6 +2338,9 @@ static int resctrl_mkdir_event_configs(struct rdt_res= ource *r, struct kernfs_nod if (ret) goto out; =20 + if (!resctrl_arch_is_evt_configurable(mevt->evtid, true)) + continue; + ret =3D rdtgroup_add_files(kn_subdir2, RFTYPE_ASSIGN_CONFIG); if (ret) break; --=20 2.43.0 From nobody Thu Apr 16 20:49:11 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C39B2D8396 for ; Wed, 25 Feb 2026 20:19:26 +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=1772050768; cv=none; b=kyCpPnp/U4Iq4dywzcik5UEgJZ5dU2rpD35HPR2d+y5EV/v0shRO7aTUaShYfG+JjKmJgzvnM/62xOTirIFs18Zz1o20hNhc6/iKlx1LZw4FvhCz3/xx1YSgLTL4hadZcztKp0IsUrAScCsYye6yhGZXO5Vdrp5E4OVW4Bg8TKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772050768; c=relaxed/simple; bh=MMzZAIFI4KCCFqXVwRJOzY7H8r21E4hvayW3p83FzKA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qe+W3R8rxAO2lJTN/SVJZMdKjiiALoKaUBBo9PxdORIVfGEerOERNb5PqOnXZftK/DWgvH5OyGLRrrJ//KqoUNZk8D7xI7NJZgSbQ6LUoTkVtnkLT7LDAzU+d26w+QFgz00je9RIRbXWZEfps9KJIxIFZapxzEB2lG+KA4bNkOQ= 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 B04A11758; Wed, 25 Feb 2026 12:19:19 -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 DD5C33F73B; Wed, 25 Feb 2026 12:19:23 -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, 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 v1 3/4] fs/resctrl: Disallow the software controller when mbm counters are assignable Date: Wed, 25 Feb 2026 20:19:04 +0000 Message-ID: <20260225201905.3568624-4-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260225201905.3568624-1-ben.horgan@arm.com> References: <20260225201905.3568624-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" The software controller requires that there are free running mbm counters for each control group in order to provide the feedback necessary to control the memory bandwidth allocation for that control group. Previous to the introduction counter assignment support (ABMC) resctrl required this in order to advertise support for mbm but now if the mbm counters are assignable then this can't be guaranteed. Currently, only AMD systems support counter assignment but the MBA is non linear and so the software controller is never supported anyway. For MPAM systems the MBA is linear and so the dependency on counters not being assignable needs to made explicit. Hence, fail the mount if the user requests the software controller, the mba_MBps option, and the mbm counters are assignable. Signed-off-by: Ben Horgan --- fs/resctrl/rdtgroup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index e79929d84317..10ff3a125751 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -2523,7 +2523,8 @@ static bool supports_mba_mbps(void) =20 return (resctrl_is_mbm_enabled() && r->alloc_capable && is_mba_linear() && - r->ctrl_scope =3D=3D rmbm->mon_scope); + r->ctrl_scope =3D=3D rmbm->mon_scope && + !rmbm->mon.mbm_cntr_assignable); } =20 /* @@ -2938,7 +2939,7 @@ static int rdt_parse_param(struct fs_context *fc, str= uct fs_parameter *param) ctx->enable_cdpl2 =3D true; return 0; case Opt_mba_mbps: - msg =3D "mba_MBps requires MBM and linear scale MBA at L3 scope"; + msg =3D "mba_MBps requires dedicated MBM counters and linear scale MBA a= t L3 scope"; if (!supports_mba_mbps()) return invalfc(fc, msg); ctx->enable_mba_mbps =3D true; --=20 2.43.0 From nobody Thu Apr 16 20:49:11 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3C9B2D73BE for ; Wed, 25 Feb 2026 20:19:28 +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=1772050779; cv=none; b=XPy4zhHsNw7osUUCPmKARK3v+VyDspKRdM5zZr7EP0vLh/TGXAerq8We1H+8oaurQyNZyexvVHzqfblFYwTlRxcBvD8uu85BNXz1i/urN1Xl8HaDOIBUNvitY8m2ByhHaoAMLhyw7ZL+5tixyJ/HhtPjn3tdPrOUsw2EU0duyvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772050779; c=relaxed/simple; bh=D0kdRHjdCd5maRr9Nvj8r9oex3El+UzCAG6ewN6xwFg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uhuL2266KDJ9XpL5VUsBvvuwWsEuPrcYeZ32CfRlmL3NCr12N+KRlt3+oGeUuz94F62MGn159YZnA3twrpK59rmt3eDrv5J0ov6dL07OlJ5Ox4ZvDeJSNB+jR7MyzfiRr8wbJNRFvXbST3XeOUbdWYdnH8kNTVnLwb1XkGBs9sY= 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 2AD37175A; Wed, 25 Feb 2026 12:19:22 -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 4BC2E3F73B; Wed, 25 Feb 2026 12:19:26 -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, 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 v1 4/4] arm_mpam: resctrl: Use new signature for resctrl_arch_is_evt_configurable() Date: Wed, 25 Feb 2026 20:19:05 +0000 Message-ID: <20260225201905.3568624-5-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260225201905.3568624-1-ben.horgan@arm.com> References: <20260225201905.3568624-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" Fix MPAM build after change to new version of resctrl_arch_is_evt_configurable(). The MPAM driver doesn't support event configuration regardless of whether default or mbm_event counter assignment mode is used and so return false unconditionally. Signed-off-by: Ben Horgan --- This patch is only here in the case it's needed to resolve a merge conflict. --- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c index 694ea8548a05..afe43034a516 100644 --- a/drivers/resctrl/mpam_resctrl.c +++ b/drivers/resctrl/mpam_resctrl.c @@ -105,7 +105,7 @@ bool resctrl_arch_mon_capable(void) return l3->mon_capable; } =20 -bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt) +bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt, bool assi= gnable) { return false; } --=20 2.43.0