aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2025-09-19 10:05:47 +0000
committerAndrew Turner <andrew@FreeBSD.org>2025-09-19 10:05:47 +0000
commit5e690f1e12ce8699f16019854dfffd1857a801d8 (patch)
tree1f43dee0b9dbe557f5034c2db09bd00dd016ffab
parent5e0e2565288f3d1f1b4223d8bb53c7d70e0aa92c (diff)
arm64: Fix enabling CPU features
Previously when enabling CPU feature we assumed the no check function means the feature was unconditionally enabled. When adding support to disable features on boot this check was incorrectly partially left in place. As all current features have a check function this meant all features were disabled. Fix this by restoring the previous behaviour while also allowing the user to disable the feature. Reviewed by: emaste Fixes: 4bc68fa98f68 ("arm64: Support managing features from loader") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D52579
-rw-r--r--sys/arm64/arm64/cpu_feat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arm64/arm64/cpu_feat.c b/sys/arm64/arm64/cpu_feat.c
index fb065ea463cf..94114d47f846 100644
--- a/sys/arm64/arm64/cpu_feat.c
+++ b/sys/arm64/arm64/cpu_feat.c
@@ -78,10 +78,11 @@ enable_cpu_feat(uint32_t stage)
PCPU_GET(cpuid) != 0)
continue;
- if (feat->feat_check != NULL)
- continue;
-
- check_status = feat->feat_check(feat, midr);
+ if (feat->feat_check != NULL) {
+ check_status = feat->feat_check(feat, midr);
+ } else {
+ check_status = FEAT_DEFAULT_ENABLE;
+ }
/* Ignore features that are not present */
if (check_status == FEAT_ALWAYS_DISABLE)
goto next;