-
由 Yandong Zhao 提交于
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: cb84d11e ("arm64: neon: Remove support for nested or hardirq kernel-mode NEON") Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: NDave Martin <Dave.Martin@arm.com> Reviewed-by: NMark Rutland <mark.rutland@arm.com> Signed-off-by: NYandong Zhao <yandong77520@gmail.com> Signed-off-by: NWill Deacon <will.deacon@arm.com>
2fd8eb4a