Commit 8e231852 authored by Andre Przywara's avatar Andre Przywara Committed by Catalin Marinas

arm64: errata: Calling enable functions for CPU errata too

Currently we call the (optional) enable function for CPU _features_
only. As CPU _errata_ descriptions share the same data structure and
having an enable function is useful for errata as well (for instance
to set bits in SCTLR), lets call it when enumerating erratas too.
Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 823066d9
...@@ -191,7 +191,9 @@ void __init setup_cpu_features(void); ...@@ -191,7 +191,9 @@ void __init setup_cpu_features(void);
void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps, void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
const char *info); const char *info);
void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps);
void check_local_cpu_errata(void); void check_local_cpu_errata(void);
void __init enable_errata_workarounds(void);
void verify_local_cpu_errata(void); void verify_local_cpu_errata(void);
void verify_local_cpu_capabilities(void); void verify_local_cpu_capabilities(void);
......
...@@ -127,3 +127,8 @@ void check_local_cpu_errata(void) ...@@ -127,3 +127,8 @@ void check_local_cpu_errata(void)
{ {
update_cpu_capabilities(arm64_errata, "enabling workaround for"); update_cpu_capabilities(arm64_errata, "enabling workaround for");
} }
void __init enable_errata_workarounds(void)
{
enable_cpu_capabilities(arm64_errata);
}
...@@ -913,8 +913,7 @@ void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps, ...@@ -913,8 +913,7 @@ void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
* Run through the enabled capabilities and enable() it on all active * Run through the enabled capabilities and enable() it on all active
* CPUs * CPUs
*/ */
static void __init void __init enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
{ {
for (; caps->matches; caps++) for (; caps->matches; caps++)
if (caps->enable && cpus_have_cap(caps->capability)) if (caps->enable && cpus_have_cap(caps->capability))
...@@ -1036,6 +1035,7 @@ void __init setup_cpu_features(void) ...@@ -1036,6 +1035,7 @@ void __init setup_cpu_features(void)
/* Set the CPU feature capabilies */ /* Set the CPU feature capabilies */
setup_feature_capabilities(); setup_feature_capabilities();
enable_errata_workarounds();
setup_elf_hwcaps(arm64_elf_hwcaps); setup_elf_hwcaps(arm64_elf_hwcaps);
if (system_supports_32bit_el0()) if (system_supports_32bit_el0())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment