From nobody Sun Feb 8 20:28:26 2026 Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06BDA2459ED for ; Wed, 7 Jan 2026 03:14:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767755656; cv=none; b=sg8QSK/U5prJIrovAeWyuZKWDD061J625BMmuuiEpv3P4kjZsa/8hZr9i5cbq0v3i166/h5oBUr+hUGaQhBWjYYFGI1sFmPRKJGv7rWZO+wvfIFkYhg3a6Zs/jwLDjO+XjIIEFe5vMB9GAGAI2DIJqcMZaUpY0wuEG6pSwu99Kw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767755656; c=relaxed/simple; bh=31zuzKz27zSUExWbBw0GjN9c+/+ynxxGS7KbJIhrSC0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=uiZqkmL8XrEoztbqKVqyXun1WMq4clmScgzGAQ7y2xZkI+F8TGwypHN3g/knj/MmL1eU20vngz5Q5qhRRx87vpZ8fuWlQMse4Yo85YqtpxgWjtrK8/KkNEDojUDOp81m7Hi0bzyp28uKbld2zKZZN76XYhmiVpi53S3PQtQAswg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=h-partners.com; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b=LPvGXzZl; arc=none smtp.client-ip=113.46.200.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=h-partners.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b="LPvGXzZl" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=YqxkYO6WRcgPyGtUHu2GKqIopFKpjFEi08T/HgNdboE=; b=LPvGXzZlvtuanE2NnDYnpP4siFhzgC2Aqk3kmLSDQpfT8MGy++H5HGFIfyc+7AAEdjp2j/d68 rPe08rtPGsnl7ITyZ2uXl5mFINyWKti+WxZF7yiUL4SlAyi8eR9/S4hiBJJUx9FXe4XRFYuNDHG 9UBk+lPHyPNsxzITr+CdBKA= Received: from mail.maildlp.com (unknown [172.19.163.15]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4dmCjD5Btcz1K96g; Wed, 7 Jan 2026 11:10:56 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id E315640539; Wed, 7 Jan 2026 11:14:09 +0800 (CST) Received: from huawei.com (10.50.87.109) by kwepemf100008.china.huawei.com (7.202.181.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Wed, 7 Jan 2026 11:14:09 +0800 From: Zeng Heng To: , , , CC: , Subject: [PATCH] arm64/mpam: Support partial-core boot for MPAM Date: Wed, 7 Jan 2026 11:13:36 +0800 Message-ID: <20260107031336.3599175-1-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 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 X-ClientProxiedBy: kwepems200002.china.huawei.com (7.221.188.68) To kwepemf100008.china.huawei.com (7.202.181.222) Content-Type: text/plain; charset="utf-8" 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 --- 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; =20 - comp =3D list_first_entry(&class->components, - struct mpam_component, class_list); - vmsc =3D 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; + } + } =20 class->props =3D vmsc->props; } @@ -2149,6 +2151,8 @@ static void mpam_enable_merge_vmsc_features(struct mp= am_component *comp) struct mpam_class *class =3D comp->class; =20 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 =3D 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 =3D 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 =3D false; + if (!msc->probed) { + cpumask_and(&mask, &msc->accessibility, cpu_online_mask); + if (!cpumask_empty(&mask)) + all_devices_probed =3D false; + } mutex_unlock(&msc->probe_lock); =20 if (!all_devices_probed) --=20 2.25.1