diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2017-04-07 17:04:19 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2017-04-07 17:04:19 +0100 |
commit | a5a3237e508e51fb63373ceafa0b45651cacbc55 (patch) | |
tree | 19bcd8e9d4450ee3370c524fdebe1180ad2a0f91 /arch/arm64/kernel/cpufeature.c | |
parent | b824b930682308ce453b73b0e3ba9686e1f3a93a (diff) | |
parent | eeb1efbcb83c0cfe6d567abbacd675bbddf3d658 (diff) | |
download | linux-a5a3237e508e51fb63373ceafa0b45651cacbc55.tar.gz linux-a5a3237e508e51fb63373ceafa0b45651cacbc55.tar.bz2 linux-a5a3237e508e51fb63373ceafa0b45651cacbc55.zip |
Merge tag 'arch-timer-errata-prereq' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into for-next/core
Pre-requisites for the arch timer errata workarounds:
- Allow checking of a CPU-local erratum
- Add CNTVCT_EL0 trap handler
- Define Cortex-A73 MIDR
- Allow an erratum to be match for all revisions of a core
- Add capability to advertise Cortex-A73 erratum 858921
* tag 'arch-timer-errata-prereq' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms:
arm64: cpu_errata: Add capability to advertise Cortex-A73 erratum 858921
arm64: cpu_errata: Allow an erratum to be match for all revisions of a core
arm64: Define Cortex-A73 MIDR
arm64: Add CNTVCT_EL0 trap handler
arm64: Allow checking of a CPU-local erratum
Diffstat (limited to 'arch/arm64/kernel/cpufeature.c')
-rw-r--r-- | arch/arm64/kernel/cpufeature.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 3e0d4f1ab5da..94b8f7fc3310 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1100,20 +1100,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; |