diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-16 16:36:04 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-17 19:36:37 +0200 |
commit | 41a574773701bf2d56fb71005117b18ca01b1845 (patch) | |
tree | 0c4833bc58d065d47a85818644853a780beb46bd | |
parent | simd: encapsulate fpu amortization into nice functions (diff) | |
download | wireguard-monolithic-historical-41a574773701bf2d56fb71005117b18ca01b1845.tar.xz wireguard-monolithic-historical-41a574773701bf2d56fb71005117b18ca01b1845.zip |
simd: no need to restore fpu state when no preemption
-rw-r--r-- | src/crypto/simd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto/simd.h b/src/crypto/simd.h index 21e3c55..07936bf 100644 --- a/src/crypto/simd.h +++ b/src/crypto/simd.h @@ -47,10 +47,12 @@ static inline void simd_put(bool was_on) static inline bool simd_relax(bool was_on) { +#ifdef CONFIG_PREEMPT if (was_on && need_resched()) { simd_put(true); return simd_get(); } +#endif return was_on; } |