ANDROID: arm64: Forcefully disable SME at runtime

In preparation for enabling the broken CONFIG_ARM64_SME option ahead of
KMI freeze, forcefully disable SME at runtime so that the broken code
remains unusable for now.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Todd Kjos <tkjos@google.com>
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 393087661
Change-Id: I1dd66318b015da02154072271e7bacae7e750940
This commit is contained in:
Will Deacon
2025-04-11 14:45:32 +01:00
committed by Treehugger Robot
parent 539d35cf76
commit f9736c87fa
+11
View File
@@ -399,6 +399,17 @@ void __init init_feature_override(u64 boot_status, const void *fdt,
parse_cmdline(fdt, chosen);
/*
* ANDROID: Forcefully disable SME at runtime until it is fixed
* upstream (b/393087661). We prefer this to disabling
* CONFIG_ARM64_SME so that the impact of the fixes on KMI is
* minimised.
*/
id_aa64pfr1_override.mask |= ID_AA64PFR1_EL1_SME;
id_aa64pfr1_override.val &= ~ID_AA64PFR1_EL1_SME;
id_aa64smfr0_override.mask = GENMASK(63, 0);
id_aa64smfr0_override.val = 0;
for (i = 0; i < ARRAY_SIZE(regs); i++) {
reg = prel64_pointer(regs[i].reg);
override = prel64_pointer(reg->override);