diff options
Diffstat (limited to 'arch/arm64/kernel/cpu_errata.c')
| -rw-r--r-- | arch/arm64/kernel/cpu_errata.c | 26 | 
1 files changed, 24 insertions, 2 deletions
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 82b0fc2e637b..0150394f4cab 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -30,6 +30,21 @@ is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int scope)  				       entry->midr_range_max);  } +static bool +has_mismatched_cache_line_size(const struct arm64_cpu_capabilities *entry, +				int scope) +{ +	WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible()); +	return (read_cpuid_cachetype() & arm64_ftr_reg_ctrel0.strict_mask) != +		(arm64_ftr_reg_ctrel0.sys_val & arm64_ftr_reg_ctrel0.strict_mask); +} + +static void cpu_enable_trap_ctr_access(void *__unused) +{ +	/* Clear SCTLR_EL1.UCT */ +	config_sctlr_el1(SCTLR_EL1_UCT, 0); +} +  #define MIDR_RANGE(model, min, max) \  	.def_scope = SCOPE_LOCAL_CPU, \  	.matches = is_affected_midr_range, \ @@ -108,6 +123,13 @@ const struct arm64_cpu_capabilities arm64_errata[] = {  	},  #endif  	{ +		.desc = "Mismatched cache line size", +		.capability = ARM64_MISMATCHED_CACHE_LINE_SIZE, +		.matches = has_mismatched_cache_line_size, +		.def_scope = SCOPE_LOCAL_CPU, +		.enable = cpu_enable_trap_ctr_access, +	}, +	{  	}  }; @@ -116,7 +138,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {   * and the related information is freed soon after. If the new CPU requires   * an errata not detected at boot, fail this CPU.   */ -void verify_local_cpu_errata(void) +void verify_local_cpu_errata_workarounds(void)  {  	const struct arm64_cpu_capabilities *caps = arm64_errata; @@ -131,7 +153,7 @@ void verify_local_cpu_errata(void)  		}  } -void check_local_cpu_errata(void) +void update_cpu_errata_workarounds(void)  {  	update_cpu_capabilities(arm64_errata, "enabling workaround for");  }  |