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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240713060944.2725647-4-zengheng4@huawei.com>
Date: Sat, 13 Jul 2024 14:09:43 +0800
From: Zeng Heng <zengheng4@...wei.com>
To: <james.morse@....com>
CC: <linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v6.10-rc1 3/4] arm_mpam: Correct the judgment condition of the CMAX feature

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 <zengheng4@...wei.com>
---
 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 = mpam_read_partsel_reg(msc, CCAP_IDR);
 
 		props->cmax_wd = 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);
+		}
 	}
 
 	/* 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);
 
 /* 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)
 
 /* MPAMF_MBW_IDR - MPAM features memory bandwidth partitioning ID register */
 #define MPAMF_MBW_IDR_BWA_WD            GENMASK(5, 0)
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ