@@ -1758,8 +1758,7 @@ has_useable_cnp(const struct arm64_cpu_capabilities *entry, int scope)
static bool __meltdown_safe = true;
static int __kpti_forced; /* 0: not forced, >0: forced on, <0: forced off */
-static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
- int scope)
+static bool needs_kpti(const struct arm64_cpu_capabilities *entry, int scope)
{
/* List of CPUs that are not vulnerable and don't need KPTI */
static const struct midr_range kpti_safe_list[] = {
@@ -2545,11 +2544,10 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
.capability = ARM64_UNMAP_KERNEL_AT_EL0,
.type = ARM64_CPUCAP_BOOT_RESTRICTED_CPU_LOCAL_FEATURE,
.cpu_enable = cpu_enable_kpti,
- .matches = unmap_kernel_at_el0,
+ .matches = needs_kpti,
/*
- * The ID feature fields below are used to indicate that
- * the CPU doesn't need KPTI. See unmap_kernel_at_el0 for
- * more details.
+ * The ID feature fields below are used to indicate that the
+ * CPU doesn't need KPTI. See needs_kpti for more details.
*/
ARM64_CPUID_FIELDS(ID_AA64PFR0_EL1, CSV3, IMP)
},
Most arm64_cpu_capabilities::matches callbacks are named to indicate that they test a boolean condition, e.g. runs_at_el2() or has_nested_virt_support(). This isn't clear for unmap_kernel_at_el0(), which can be read as an action rather than a boolean condition, and it's not immediately clear that this is related to KPTI. Rename unmap_kernel_at_el0() to needs_kpti() to make this clearer. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> --- arch/arm64/kernel/cpufeature.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)