arm64: cpufeature: Detect BBML3 based on ID_AA64MMFR2_EL1.BBM
authorLinu Cherian <linu.cherian@arm.com>
Thu, 23 Jul 2026 04:40:33 +0000 (10:10 +0530)
committerWill Deacon <will@kernel.org>
Thu, 6 Aug 2026 12:15:30 +0000 (12:15 +0000)
Add ID_AA64MMFR2_EL1.BBM based BBML3 feature detection in
cpu_supports_bbml3() so that cpus with the feature would
not have to be added into MIDR based supports_bbml3_list.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Linu Cherian <linu.cherian@arm.com>
[will: Tidy up cpu_supports_bbml3()]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/cpufeature.c

index 896bafd..4025d51 100644 (file)
@@ -2153,16 +2153,12 @@ bool cpu_supports_bbml3(void)
                MIDR_RANGE(MIDR_C1_PREMIUM, 1, 1, 0xf, 0xf),
                {}
        };
+       u64 mmfr2 = __read_sysreg_by_encoding(SYS_ID_AA64MMFR2_EL1);
 
-       if (!is_midr_in_range_list(supports_bbml3_list))
-               return false;
-
-       /*
-        * We currently ignore the ID_AA64MMFR2_EL1 register, and only care
-        * about whether the MIDR check passes.
-        */
+       if (SYS_FIELD_GET(ID_AA64MMFR2_EL1, BBM, mmfr2) >= ID_AA64MMFR2_EL1_BBM_3)
+               return true;
 
-       return true;
+       return is_midr_in_range_list(supports_bbml3_list);
 }
 
 static bool has_bbml3(const struct arm64_cpu_capabilities *caps, int scope)