]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: capabilities: Handle duplicate entries for a capability
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 9 Jan 2018 16:12:18 +0000 (16:12 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 15 Jan 2018 18:00:34 +0000 (18:00 +0000)
commit819c1825b02121eecbf461fed086f8e2036a7af0
tree11e0c889cc1c62d3ebfef4815b007a48d5e9c7f2
parent87a74411cdbd53d15a4855f12a24857fd491ca3a
arm64: capabilities: Handle duplicate entries for a capability

Sometimes a single capability could be listed multiple times with
differing matches(), e.g, CPU errata for different MIDR versions.
This breaks verify_local_cpu_feature() and this_cpu_has_cap() as
we stop checking for a capability on a CPU with the first
entry in the given table, which is not sufficient. Make sure we
run the checks for all entries of the same capability. We do
this by fixing __this_cpu_has_cap() to run through all the
entries in the given table for a match and reuse it for
verify_local_cpu_feature().

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/cpufeature.c