diff options
author | Mark Brown <broonie@kernel.org> | 2018-07-18 13:37:19 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-07-18 13:37:19 +0100 |
commit | faf34726275b225a9954f2901364c053e6e3d1f0 (patch) | |
tree | 3ac169b40a37387cf986331b9371db8b0c5b7af7 /arch/arm64 | |
parent | 77c2bedd8f1658a47e015e77ee1f86b619707735 (diff) | |
parent | cff26c95b24c7b7147db17b623dee946bd25ec95 (diff) |
Merge tag 'v4.14.56' into linux-linaro-lsk-v4.14
This is the 4.14.56 stable release
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/include/asm/simd.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/arm64/include/asm/simd.h b/arch/arm64/include/asm/simd.h index fa8b3fe932e6..6495cc51246f 100644 --- a/arch/arm64/include/asm/simd.h +++ b/arch/arm64/include/asm/simd.h @@ -29,20 +29,15 @@ DECLARE_PER_CPU(bool, kernel_neon_busy); static __must_check inline bool may_use_simd(void) { /* - * The raw_cpu_read() is racy if called with preemption enabled. - * This is not a bug: kernel_neon_busy is only set when - * preemption is disabled, so we cannot migrate to another CPU - * while it is set, nor can we migrate to a CPU where it is set. - * So, if we find it clear on some CPU then we're guaranteed to - * find it clear on any CPU we could migrate to. - * - * If we are in between kernel_neon_begin()...kernel_neon_end(), - * the flag will be set, but preemption is also disabled, so we - * can't migrate to another CPU and spuriously see it become - * false. + * kernel_neon_busy is only set while preemption is disabled, + * and is clear whenever preemption is enabled. Since + * this_cpu_read() is atomic w.r.t. preemption, kernel_neon_busy + * cannot change under our feet -- if it's set we cannot be + * migrated, and if it's clear we cannot be migrated to a CPU + * where it is set. */ return !in_irq() && !irqs_disabled() && !in_nmi() && - !raw_cpu_read(kernel_neon_busy); + !this_cpu_read(kernel_neon_busy); } #else /* ! CONFIG_KERNEL_MODE_NEON */ |