arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early
authorMark Rutland <mark.rutland@arm.com>
Thu, 12 Apr 2018 11:11:07 +0000 (12:11 +0100)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 15 May 2018 11:21:16 +0000 (04:21 -0700)
commit484099ffe906e4db78bae538c217c226ac3cdee7
tree203b83a9da24081a69a9819b2a4a882db910ce90
parentd9e5bb5cc120f3fe1d14905374f30cdf5a2ca1e4
arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early

PD#166068: arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early

From: James Morse <james.morse@arm.com>

Fix CPU-hotplug fail to bringup issue once stopped CPU.

commit edf298cfce47ab7279d03b5203ae2ef3a58e49db upstream.

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.

Change-Id: I29788b05eb636de777de5d4f423097804d465a7b
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: Mark Rutland <mark.rutland@arm.com> [v4.9 backport]
Tested-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
arch/arm64/kernel/cpufeature.c