From nobody Mon Feb 9 01:49:11 2026 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 EF59929401 for ; Sat, 13 Jul 2024 06:13:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851219; cv=none; b=Ds9zH+6YC3kldItXWbEBz64RgexesMGM6z6qhEgAxJf0sq4r9th+7ig4/g9AtO+w3xObNjRd+L7RspyZokYKmvRT1jAcx+Ef9g/FtPgeGwtlMOz2yKd3AK20+9p7XYGmnlNfeOtg6u70TZjYEl/XQwLGiWrx1SCqyqzMJPcineY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851219; c=relaxed/simple; bh=/FwUgcdl80YqwSBVtTSXOnlfHZUrYZbOTEATrkgSxTI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GzuvZK55Sd6DIJlDuLz8LDE/QZlaEDa2qhgmfU+9YRpvEHvWziR7hSGcUdyssIMnTX0/CEmMBxAT9CNrVobSSCciOI6PC8DQn3rNMpSgofaouYp3lW2Nx5vw1bGJWGbVdYimKD150P+SUXYbSmzZmXfrXp8I1nhnikWVvw+Ce/M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WLdMy2fxgzQlSJ; Sat, 13 Jul 2024 14:09:34 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id 44C87140361; Sat, 13 Jul 2024 14:13:33 +0800 (CST) Received: from huawei.com (10.175.103.91) 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.11; Sat, 13 Jul 2024 14:13:32 +0800 From: Zeng Heng To: CC: , Subject: [PATCH v6.10-rc1 1/4] arm_mpam: Correct MBA granularity calculation Date: Sat, 13 Jul 2024 14:09:41 +0800 Message-ID: <20240713060944.2725647-2-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240713060944.2725647-1-zengheng4@huawei.com> References: <20240713060944.2725647-1-zengheng4@huawei.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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemf100008.china.huawei.com (7.202.181.222) Content-Type: text/plain; charset="utf-8" Correct MBA granularity calculation function. As said in the comments, "bwa_wd is the number of bits implemented in the 0.xxx fixed point fraction". Fixes: 867471fefd5c ("SPLIT untested: arm_mpam: resctrl: Add support for MB= resource") Signed-off-by: Zeng Heng --- drivers/platform/arm64/mpam/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/= arm64/mpam/mpam_resctrl.c index 2fa732a42d4f..a217f2e1f350 100644 --- a/drivers/platform/arm64/mpam/mpam_resctrl.c +++ b/drivers/platform/arm64/mpam/mpam_resctrl.c @@ -523,7 +523,7 @@ static u32 get_mba_granularity(struct mpam_props *cprop= s) * bwa_wd is the number of bits implemented in the 0.xxx * fixed point fraction. 1 bit is 50%, 2 is 25% etc. */ - return MAX_MBA_BW / (cprops->bwa_wd + 1); + return MAX_MBA_BW / (1 << cprops->bwa_wd); } =20 return 0; --=20 2.25.1 From nobody Mon Feb 9 01:49:11 2026 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 BEF43374F1 for ; Sat, 13 Jul 2024 06:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851224; cv=none; b=VPkNdax73S6WBUxPeCQDNFVxt0uKV83ghSI9coPF7NycVSyhq9qAtZSLGsuKbOo8sUQEGG34kyUwOXQv3iUCwkNOmriFJ1i+yW7HDduYxZwCewkO2gtdSB9zWvfBieVjSnbCdPr3zJ+TeNLlxts2uuIa0G/KHqQ90Zbt3RA1ATo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851224; c=relaxed/simple; bh=c2a+MUNNmJv4IziUEEbzft8eTTiPu1rIEDhOjFqvxsA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KLckjMnt2arKCiDto2C4/8aFhwelUH7h/Gj+YYOrZVULSjKhvj21eSapgPKNCmW3FnqnZ5mKH0T/iz9ZG1HCjO8mvMgHb/i3bytYPfjhtdSPwly1W1YImTGc5mSLNSfdsODeWvCcw1lb0Gj1ZOYpWJjkn908N1/R0jtUlKAfMtw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WLdMf3HwNz1X4dH; Sat, 13 Jul 2024 14:09:18 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id B316D1A016C; Sat, 13 Jul 2024 14:13:33 +0800 (CST) Received: from huawei.com (10.175.103.91) 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.11; Sat, 13 Jul 2024 14:13:33 +0800 From: Zeng Heng To: CC: , Subject: [PATCH v6.10-rc1 2/4] arm_mpam: Fix the range calculation of the implemented bits Date: Sat, 13 Jul 2024 14:09:42 +0800 Message-ID: <20240713060944.2725647-3-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240713060944.2725647-1-zengheng4@huawei.com> References: <20240713060944.2725647-1-zengheng4@huawei.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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemf100008.china.huawei.com (7.202.181.222) Content-Type: text/plain; charset="utf-8" The implemented bits of the MAX field in the MPAMCFG_{MBW_MAX, CMAX} register are always to the left of the field, so the validated range should be like [15, 15 - width + 1]. Fixes: 867471fefd5c ("SPLIT untested: arm_mpam: resctrl: Add support for MB= resource") Signed-off-by: Zeng Heng --- drivers/platform/arm64/mpam/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/= arm64/mpam/mpam_resctrl.c index a217f2e1f350..e87fca6fc5fd 100644 --- a/drivers/platform/arm64/mpam/mpam_resctrl.c +++ b/drivers/platform/arm64/mpam/mpam_resctrl.c @@ -585,7 +585,7 @@ static u16 percent_to_mbw_max(u8 pc, struct mpam_props = *cprops) break; } =20 - value &=3D GENMASK(15, 15 - cprops->bwa_wd); + value &=3D GENMASK(15, 15 - cprops->bwa_wd + 1); =20 return value; } --=20 2.25.1 From nobody Mon Feb 9 01:49:11 2026 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 BEF84381D5 for ; Sat, 13 Jul 2024 06:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851223; cv=none; b=lgTkAc/t0NTguknQCAM8vmHITRSHjtEuoaL6wFgEqkCymLeaoyRfFKgCxac42jKOGV9iblmler+58C2lJNrssAJQ0MI2+N3B+lCnPUIdykpL27irWruGC0y2qxrUkXL5HhAv3+i+eSi+3SqVO5kqRCZUPE0sJAibJJeeAUwhVv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851223; c=relaxed/simple; bh=pRysUHIv8ye9ZAnFZcRDd5Yr1XT1Elzpnisa/eQLrwg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pTuGLfj9gzdilbWnTyLw5aSVutulncmBfRVdUR57/HghftoAIdqzJ5QyCzdZ0e3axU8QsVfRAAeyQXK4tX/kyHcJOppsd/7jkToYplvvPbECE1bCVXHuLnT9HOBotnVyD8WT3FpIzrOD3N3CCA79YeOhyUjaZNTmogvs1sRCXxE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WLdMf6WS7z1X4gK; Sat, 13 Jul 2024 14:09:18 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id 2D90F1A0188; Sat, 13 Jul 2024 14:13:34 +0800 (CST) Received: from huawei.com (10.175.103.91) 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.11; Sat, 13 Jul 2024 14:13:33 +0800 From: Zeng Heng To: CC: , Subject: [PATCH v6.10-rc1 3/4] arm_mpam: Correct the judgment condition of the CMAX feature Date: Sat, 13 Jul 2024 14:09:43 +0800 Message-ID: <20240713060944.2725647-4-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240713060944.2725647-1-zengheng4@huawei.com> References: <20240713060944.2725647-1-zengheng4@huawei.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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemf100008.china.huawei.com (7.202.181.222) Content-Type: text/plain; charset="utf-8" According to Arm Architecture MPAM Reference Manual (version DDI 0598D.b), to check whether hardware supports the CMAX feature or not, not only needs to check the CMAX_WD field of the MPAMF_CCAP_IDR register, but also needs to check the NO_CMAX field. Fixes: a275036b6767 ("arm_mpam: Probe and reset the rest of the features") Signed-off-by: Zeng Heng --- drivers/platform/arm64/mpam/mpam_devices.c | 6 ++++-- drivers/platform/arm64/mpam/mpam_internal.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/arm64/mpam/mpam_devices.c b/drivers/platform/= arm64/mpam/mpam_devices.c index acb91352c524..9acac8a22573 100644 --- a/drivers/platform/arm64/mpam/mpam_devices.c +++ b/drivers/platform/arm64/mpam/mpam_devices.c @@ -779,8 +779,10 @@ static void mpam_ris_hw_probe(struct mpam_msc_ris *ris) u32 ccap_features =3D mpam_read_partsel_reg(msc, CCAP_IDR); =20 props->cmax_wd =3D FIELD_GET(MPAMF_CCAP_IDR_CMAX_WD, ccap_features); - if (props->cmax_wd) - mpam_set_feature(mpam_feat_ccap_part, props); + if (props->cmax_wd) { + if (!FIELD_GET(MPAMF_CCAP_IDR_NO_CMAX, ccap_features)) + mpam_set_feature(mpam_feat_ccap_part, props); + } } =20 /* Cache Portion partitioning */ diff --git a/drivers/platform/arm64/mpam/mpam_internal.h b/drivers/platform= /arm64/mpam/mpam_internal.h index 61aea729aa73..0e714ce7fa96 100644 --- a/drivers/platform/arm64/mpam/mpam_internal.h +++ b/drivers/platform/arm64/mpam/mpam_internal.h @@ -450,6 +450,7 @@ void mpam_resctrl_exit(void); =20 /* MPAMF_CCAP_IDR - MPAM features cache capacity partitioning ID register = */ #define MPAMF_CCAP_IDR_CMAX_WD GENMASK(5, 0) +#define MPAMF_CCAP_IDR_NO_CMAX BIT(30) =20 /* MPAMF_MBW_IDR - MPAM features memory bandwidth partitioning ID register= */ #define MPAMF_MBW_IDR_BWA_WD GENMASK(5, 0) --=20 2.25.1 From nobody Mon Feb 9 01:49:11 2026 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 AD48738F9C for ; Sat, 13 Jul 2024 06:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851224; cv=none; b=ZvFLE5BHLGki2li6+G+fE/hjAmRj/2sv7XLLHoen9lR59x2QxNGUTV5VV4TsPVqbOYF60zSlNcZC8VUykOG9/nE9RYV/bHiQGFWH+MInSeKV+QqR5iuW46tTIceSUQbPLEC9JW1f1BDYZL/Yf92AZCi/TuBTlTllH5zMT29jOzc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720851224; c=relaxed/simple; bh=OmWu9roJ8Ekx1OC9ld+LTwlVUjG9XH4xD1JTTUre6so=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QojWPi6xGTrUFOjfeggOv3+l2Pi4pWKOSgWzh6tajKinhUQQUg3I1UuxfPK5svWTO7ANykNd5kDlwdk1BoJ/BHKxSdqFzU1Nt+fHnEuHeplZC+LYiW3FvH2Np022wwYI/cz4D0Jgvk/7SFdE5qgOhl8j19IK+cqkWc+rnAeEyrc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WLdM41LmHzxSSL; Sat, 13 Jul 2024 14:08:48 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id 96642180088; Sat, 13 Jul 2024 14:13:34 +0800 (CST) Received: from huawei.com (10.175.103.91) 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.11; Sat, 13 Jul 2024 14:13:34 +0800 From: Zeng Heng To: CC: , Subject: [PATCH v6.10-rc1 4/4] arm_mpam: Fix typo about mbw_min controls Date: Sat, 13 Jul 2024 14:09:44 +0800 Message-ID: <20240713060944.2725647-5-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240713060944.2725647-1-zengheng4@huawei.com> References: <20240713060944.2725647-1-zengheng4@huawei.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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemf100008.china.huawei.com (7.202.181.222) Content-Type: text/plain; charset="utf-8" Correct the judgment condition about mbw_min default value. Fixes: 099f47353bc5 ("arm_mpam: Generate a configuration for min controls") Signed-off-by: Zeng Heng --- drivers/platform/arm64/mpam/mpam_devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/arm64/mpam/mpam_devices.c b/drivers/platform/= arm64/mpam/mpam_devices.c index 9acac8a22573..64a1f1767a68 100644 --- a/drivers/platform/arm64/mpam/mpam_devices.c +++ b/drivers/platform/arm64/mpam/mpam_devices.c @@ -1483,7 +1483,7 @@ static void mpam_reprogram_ris_partid(struct mpam_msc= _ris *ris, u16 partid, } =20 if (mpam_has_feature(mpam_feat_mbw_min, rprops)) { - if (mpam_has_feature(mpam_feat_mbw_max, cfg)) + if (mpam_has_feature(mpam_feat_mbw_min, cfg)) mpam_write_partsel_reg(msc, MBW_MIN, cfg->mbw_min); else mpam_write_partsel_reg(msc, MBW_MIN, 0); --=20 2.25.1