lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260107031336.3599175-1-zengheng4@huawei.com>
Date: Wed, 7 Jan 2026 11:13:36 +0800
From: Zeng Heng <zengheng4@...wei.com>
To: <james.morse@....com>, <ben.horgan@....com>, <fenghuay@...dia.com>,
	<reinette.chatre@...el.com>
CC: <wangkefeng.wang@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] arm64/mpam: Support partial-core boot for MPAM

Some MPAM MSCs (like L2 MSC) shares the same power domain with its
associated CPUs. Therefore, in scenarios where only partial cores power
up, the MSCs belonging to the un-powered cores don't need and should not
be accessed, otherwise bus-access fault would occur.

In such non-full core boot scenarios, the MSCs corresponding to offline
CPUs should skip. If the MSC's accessibility mask doesn't contain any
online CPU, this MSC remains uninitialized.

During initialization of class->props, skip any MSC that is not powered
up, so that ensure the class->props member unaffected from uninitialized
vmsc->props in mpam_enable_init_class_features() and
mpam_enable_merge_vmsc_features().

Signed-off-by: Zeng Heng <zengheng4@...wei.com>
---
 drivers/resctrl/mpam_devices.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index 0b5b158e1aaf..488ad2e40f66 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -2134,10 +2134,12 @@ static void mpam_enable_init_class_features(struct mpam_class *class)
 	struct mpam_vmsc *vmsc;
 	struct mpam_component *comp;
 
-	comp = list_first_entry(&class->components,
-				struct mpam_component, class_list);
-	vmsc = list_first_entry(&comp->vmsc,
-				struct mpam_vmsc, comp_list);
+	list_for_each_entry(comp, &class->components, class_list) {
+		list_for_each_entry(vmsc, &comp->vmsc, comp_list) {
+			if (vmsc->msc->probed)
+				break;
+		}
+	}
 
 	class->props = vmsc->props;
 }
@@ -2149,6 +2151,8 @@ static void mpam_enable_merge_vmsc_features(struct mpam_component *comp)
 	struct mpam_class *class = comp->class;
 
 	list_for_each_entry(vmsc, &comp->vmsc, comp_list) {
+		if (!vmsc->msc->probed)
+			continue;
 		list_for_each_entry(ris, &vmsc->ris, vmsc_list) {
 			__vmsc_props_mismatch(vmsc, ris);
 			class->nrdy_usec = max(class->nrdy_usec,
@@ -2620,6 +2624,7 @@ void mpam_disable(struct work_struct *ignored)
  */
 void mpam_enable(struct work_struct *work)
 {
+	cpumask_t mask;
 	static atomic_t once;
 	struct mpam_msc *msc;
 	bool all_devices_probed = true;
@@ -2629,8 +2634,11 @@ void mpam_enable(struct work_struct *work)
 	list_for_each_entry_srcu(msc, &mpam_all_msc, all_msc_list,
 				 srcu_read_lock_held(&mpam_srcu)) {
 		mutex_lock(&msc->probe_lock);
-		if (!msc->probed)
-			all_devices_probed = false;
+		if (!msc->probed) {
+			cpumask_and(&mask, &msc->accessibility, cpu_online_mask);
+			if (!cpumask_empty(&mask))
+				all_devices_probed = false;
+		}
 		mutex_unlock(&msc->probe_lock);
 
 		if (!all_devices_probed)
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ