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.
--- 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: 5c40a1750f44dd6c7292d8c8d0b4ffff1734576e
Signature · 1 line
2.56.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] raid6: missing Fixes trailer for AVX-512 xor_syndrome commit 694dda62d286 --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] raid6: missing Fixes trailer for AVX-512 xor_syndrome commit 694dda62d286
--
commit 369a70502fe6ce19affa3189f8d493476e955e10
Author: Eric Biggers <[email protected]>
Quoted 8 lines
raid6: add missing vzeroupper to AVX-512 code
commit
b82cf9e49c1be7cf1fd8e1bd806b0cdd25ab8127upstream.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.
Quoted 7 lines
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]>
[Severity: Low]
In addition to the gen_syndrome and recovery functions, this patch adds vzeroupper to raid6_avx5121_xor_syndrome(), raid6_avx5122_xor_syndrome(), and raid6_avx5124_xor_syndrome(). Should this also include:
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1