original_kernel/arch/arm64
Yandong Zhao 2fd8eb4ad8 arm64: neon: Fix function may_use_simd() return error status
It does not matter if the caller of may_use_simd() migrates to
another cpu after the call, but it is still important that the
kernel_neon_busy percpu instance that is read matches the cpu the
task is running on at the time of the read.

This means that raw_cpu_read() is not sufficient.  kernel_neon_busy
may appear true if the caller migrates during the execution of
raw_cpu_read() and the next task to be scheduled in on the initial
cpu calls kernel_neon_begin().

This patch replaces raw_cpu_read() with this_cpu_read() to protect
against this race.

Cc: <stable@vger.kernel.org>
Fixes: cb84d11e16 ("arm64: neon: Remove support for nested or hardirq kernel-mode NEON")
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Yandong Zhao <yandong77520@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2018-07-11 17:02:02 +01:00
..
boot ARM64: hisi fixes for 4.18 2018-06-29 14:06:49 -07:00
configs arm64: defconfig: renormalize based on recent additions 2018-06-23 10:24:25 -07:00
crypto crypto: arm64/aes-blk - fix and move skcipher_walk_done out of kernel_neon_begin, _end 2018-06-15 23:06:46 +08:00
include arm64: neon: Fix function may_use_simd() return error status 2018-07-11 17:02:02 +01:00
kernel arm64: Avoid flush_icache_range() in alternatives patching code 2018-06-27 18:21:53 +01:00
kvm KVM: arm64: Avoid mistaken attempts to save SVE state for vcpus 2018-06-21 09:14:44 +01:00
lib
mm arm64: mm: Ensure writes to swapper are ordered wrt subsequent cache maintenance 2018-06-22 17:23:40 +01:00
net
xen
Kconfig Kbuild: rename HAVE_CC_STACKPROTECTOR config variable 2018-06-15 07:15:28 +09:00
Kconfig.debug
Kconfig.platforms
Makefile Revert "arm64: Use aarch64elf and aarch64elfb emulation mode variants" 2018-07-10 10:16:54 +01:00