]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 22 Feb 2018 14:15:46 +0000 (08:15 -0600)
commitf76bd0887277efae2aa72fb7eff79e81a75877d7
treef6612fd05f225c92dd61d024b15f86320f71f7b4
parentd272070a49e58d7077d11cddc9fa637a722a1d38
arm64: capabilities: Handle duplicate entries for a capability

BugLink: http://bugs.launchpad.net/bugs/1751064
Commit 67948af41f2e upstream.

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>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/arm64/kernel/cpufeature.c