From 6877642528074a0275b869c7d7b1207652e66f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20F=C3=BCl=C3=B6p?= Date: Wed, 1 Mar 2023 19:29:47 +0100 Subject: [PATCH] Use XRSTOR with XSAVEC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Fülöp --- include/os/linux/kernel/linux/simd_x86.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/os/linux/kernel/linux/simd_x86.h b/include/os/linux/kernel/linux/simd_x86.h index ff4e2466d5..bd987f08c9 100644 --- a/include/os/linux/kernel/linux/simd_x86.h +++ b/include/os/linux/kernel/linux/simd_x86.h @@ -378,6 +378,13 @@ static inline void kfpu_end(void) { uint8_t *state = zfs_kfpu_fpregs[smp_processor_id()]; + +#if defined(HAVE_XSAVEC) + if (static_cpu_has(X86_FEATURE_XSAVEC)) { + kfpu_do_xrstor("xrstor", state, ~0); + goto out; + } +#endif #if defined(HAVE_XSAVES) if (static_cpu_has(X86_FEATURE_XSAVES)) { kfpu_do_xrstor("xrstors", state, ~0);