git: 5e690f1e12ce - main - arm64: Fix enabling CPU features
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 19 Sep 2025 10:30:09 UTC
The branch main has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=5e690f1e12ce8699f16019854dfffd1857a801d8
commit 5e690f1e12ce8699f16019854dfffd1857a801d8
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2025-09-19 10:05:47 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2025-09-19 10:05:47 +0000
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
---
sys/arm64/arm64/cpu_feat.c | 9 +++++----
1 file 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;