|
@@ -1090,20 +1090,29 @@ static void __init setup_feature_capabilities(void)
|
|
|
* Check if the current CPU has a given feature capability.
|
|
|
* Should be called from non-preemptible context.
|
|
|
*/
|
|
|
-bool this_cpu_has_cap(unsigned int cap)
|
|
|
+static bool __this_cpu_has_cap(const struct arm64_cpu_capabilities *cap_array,
|
|
|
+ unsigned int cap)
|
|
|
{
|
|
|
const struct arm64_cpu_capabilities *caps;
|
|
|
|
|
|
if (WARN_ON(preemptible()))
|
|
|
return false;
|
|
|
|
|
|
- for (caps = arm64_features; caps->desc; caps++)
|
|
|
+ for (caps = cap_array; caps->desc; caps++)
|
|
|
if (caps->capability == cap && caps->matches)
|
|
|
return caps->matches(caps, SCOPE_LOCAL_CPU);
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+extern const struct arm64_cpu_capabilities arm64_errata[];
|
|
|
+
|
|
|
+bool this_cpu_has_cap(unsigned int cap)
|
|
|
+{
|
|
|
+ return (__this_cpu_has_cap(arm64_features, cap) ||
|
|
|
+ __this_cpu_has_cap(arm64_errata, cap));
|
|
|
+}
|
|
|
+
|
|
|
void __init setup_cpu_features(void)
|
|
|
{
|
|
|
u32 cwg;
|