raid6: add missing vzeroupper to AVX2 code
Subsystems (2)
PATCH 1/1 raid6: add missing vzeroupper to AVX2 code
commit 24f1241cdb056fd630e6710a916e0f7c8c910a70 upstream.
Since the AVX2 optimized RAID6 code uses YMM 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 2c935842bdb4 ("lib/raid6: Add AVX2 optimized gen_syndrome functions")
Fixes 7056741fd9fc ("lib/raid6: Add AVX2 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/avx2.c | 6 ++++++ lib/raid6/recov_avx2.c | 2 ++ 2 files changed, 8 insertions(+)
lib/raid6/avx2.c +6 -0
@@ -76,6 +76,7 @@ static void raid6_avx21_gen_syndrome(int disks, size_t bytes, void **ptrs) } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -124,6 +125,7 @@ static void raid6_avx21_xor_syndrome(int disks, int start, int stop, } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -186,6 +188,7 @@ static void raid6_avx22_gen_syndrome(int disks, size_t bytes, void **ptrs) } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -254,6 +257,7 @@ static void raid6_avx22_xor_syndrome(int disks, int start, int stop, } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -347,6 +351,7 @@ static void raid6_avx24_gen_syndrome(int disks, size_t bytes, void **ptrs) } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -457,6 +462,7 @@ static void raid6_avx24_xor_syndrome(int disks, int start, int stop, asmvolatile ("vmovntdq %%ymm14,%0" :"=m" (q[d+96 ])); } asmvolatile ("sfence" : : :"memory" ); + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
lib/raid6/recov_avx2.c +2 -0
@@ -180,6 +180,7 @@ static void raid6_2data_recov_avx2(int disks, size_t bytes, int faila,#endif } + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
@@ -297,6 +298,7 @@ static void raid6_datap_recov_avx2(int disks, size_t bytes, int faila,#endif } + asmvolatile ("vzeroupper" );kernel_fpu_end (); }
base-commit: 3a323bc22b881a5bdc1646080f93f5ecb22850bf
Signature · 1 line
2.56.0