]> 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)
commit0bcc06d894de62c5b6c66962079a83eccb1c511c
tree11e0c889cc1c62d3ebfef4815b007a48d5e9c7f2
parentf4e8f4b3ed682b2eaa32f0bb89f3c339f31b9651
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