arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early
authorJames Morse <james.morse@arm.com>
Fri, 23 Feb 2018 14:31:42 +0000 (22:31 +0800)
committerHaibo Chen <haibo.chen@nxp.com>
Thu, 12 Apr 2018 10:46:24 +0000 (18:46 +0800)
commit8af8958bca687f1d6bc5f0e32b8c2e604ac8681a
tree9ddb1630b6a1a1c891e589dcc1cb94d919f34117
parent05037ebe075568f9a835e67ac786b1198cc524de
arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early

commit edf298cfce47 upstream.
Alex Shi rewrite this commit on func this_cpu_has_cap(). The following commit
log is still meaningful.

    this_cpu_has_cap() tests caps->desc not caps->matches, so it stops
    walking the list when it finds a 'silent' feature, instead of
    walking to the end of the list.

    Prior to v4.6's 644c2ae198412 ("arm64: cpufeature: Test 'matches' pointer
    to find the end of the list") we always tested desc to find the end of
    a capability list. This was changed for dubious things like PAN_NOT_UAO.
    v4.7's e3661b128e53e ("arm64: Allow a capability to be checked on
    single CPU") added this_cpu_has_cap() using the old desc style test.

CC: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/include/asm/futex.h
arch/arm64/kernel/cpufeature.c