[PATCH v2 3/3] arm64: cpufeature: Change 32-bit EL0 to display enabled cores

From: Jeremy Linton
Date: Tue Oct 17 2023 - 01:23:48 EST


Now that we have the ability to display the list of cores
with a feature when it is selectivly enabled, lets display the
cores enabled for 32-bit use at EL0.

Signed-off-by: Jeremy Linton <jeremy.linton@xxxxxxx>
---
arch/arm64/kernel/cpufeature.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index b7b67bac0e60..512cbe446b41 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1533,8 +1533,17 @@ static bool has_32bit_el0(const struct arm64_cpu_capabilities *entry, int scope)
if (!has_cpuid_feature(entry, scope))
return allow_mismatched_32bit_el0;

- if (scope == SCOPE_SYSTEM)
- pr_info("detected: 32-bit EL0 Support\n");
+ if (scope == SCOPE_SYSTEM) {
+ struct arm64_cpu_capabilities *has_32bit;
+
+ has_32bit = (struct arm64_cpu_capabilities *)entry;
+
+ has_32bit->cpus = system_32bit_el0_cpumask();
+ if (has_32bit->cpus == cpu_possible_mask)
+ has_32bit->cpus = cpu_online_mask;
+ if (has_32bit->cpus == cpu_none_mask)
+ has_32bit->cpus = NULL;
+ }

return true;
}
@@ -2307,9 +2316,11 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
ARM64_CPUID_FIELDS(ID_AA64MMFR2_EL1, NV, IMP)
},
{
+ .desc = "32-bit EL0 Support",
.capability = ARM64_HAS_32BIT_EL0_DO_NOT_USE,
.type = ARM64_CPUCAP_SYSTEM_FEATURE,
.matches = has_32bit_el0,
+ .cpus = cpu_none_mask,
ARM64_CPUID_FIELDS(ID_AA64PFR0_EL1, EL0, AARCH32)
},
#ifdef CONFIG_KVM
--
2.41.0