1
0
Fork 0
remarkable-linux/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 arm64: export tishift functions to modules 2018-05-21 19:00:48 +01:00
mm arm64: mm: Ensure writes to swapper are ordered wrt subsequent cache maintenance 2018-06-22 17:23:40 +01:00
net bpf, arm64: save 4 bytes in prologue when ebpf insns came from cbpf 2018-05-14 19:11:45 -07:00
xen arm64: mm: Add additional parameter to uaccess_ttbr0_disable 2018-01-17 13:57:49 +01:00
Kconfig Kbuild: rename HAVE_CC_STACKPROTECTOR config variable 2018-06-15 07:15:28 +09:00
Kconfig.debug arm64: relocation testing module 2017-04-04 17:03:32 +01:00
Kconfig.platforms arm64: dts: renesas: Add Renesas R8A77990 Kconfig support 2018-05-16 10:44:01 +02:00
Makefile Revert "arm64: Use aarch64elf and aarch64elfb emulation mode variants" 2018-07-10 10:16:54 +01:00