raid6: add missing vzeroupper to AVX-512 code
Subsystems (2)
PATCH 1/1 raid6: add missing vzeroupper to AVX-512 code
commit b82cf9e49c1be7cf1fd8e1bd806b0cdd25ab8127 upstream.
Since the AVX-512 optimized RAID6 code uses ZMM registers, execute vzeroupper before returning from it. This is needed to avoid degrading the performance of any later SSE code that may happen to be executed.
Fixes e0a491c12968 ("lib/raid6: Add AVX512 optimized gen_syndrome functions")
Fixes 13c520b2993c ("lib/raid6: Add AVX512 optimized recovery functions")
Signed-off-by Eric Biggers <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc <[email protected]>
--- lib/raid6/avx512.c | 6 ++++++ lib/raid6/recov_avx512.c | 2 ++ 2 files changed, 8 insertions(+)
lib/raid6/avx512.c +6 -0
@@ -95,6 +95,7 @@ static void raid6_avx5121_gen_syndrome(int disks, size_t bytes, void **ptrs) } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -154,6 +155,7 @@ static void raid6_avx5121_xor_syndrome(int disks, int start, int stop, } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -227,6 +229,7 @@ static void raid6_avx5122_gen_syndrome(int disks, size_t bytes, void **ptrs) } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -311,6 +314,7 @@ static void raid6_avx5122_xor_syndrome(int disks, int start, int stop, } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -417,6 +421,7 @@ static void raid6_avx5124_gen_syndrome(int disks, size_t bytes, void **ptrs) } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -550,6 +555,7 @@ static void raid6_avx5124_xor_syndrome(int disks, int start, int stop, "m" (q[d+128]), "m" (q[d+192])); } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }const struct raid6_calls raid6_avx512x4 = {
lib/raid6/recov_avx512.c +2 -0
@@ -221,6 +221,7 @@ static void raid6_2data_recov_avx512(int disks, size_t bytes, int faila,#endif } + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -363,6 +364,7 @@ static void raid6_datap_recov_avx512(int disks, size_t bytes, int faila,#endif } + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
base-commit: c75b0cf0982c00cddfd88d1acf3872f79b40980c
Signature · 1 line
2.56.0