mirror_zfs/module/zcommon
Attila Fülöp 8e94ac0e36
Linux 5.16 compat: don't use XSTATE_XSAVE to save FPU state
Linux 5.16 moved XSTATE_XSAVE and XSTATE_XRESTORE out of our reach,
so add our own XSAVE{,OPT,S} code and use it for Linux 5.16.

Please note that this differs from previous behavior in that it
won't handle exceptions created by XSAVE an XRSTOR. This is sensible
for three reasons.

 - Exceptions during XSAVE and XRSTOR can only occur if the feature
   is not supported or enabled or the memory operand isn't aligned
   on a 64 byte boundary. If this happens something else went
   terribly wrong, and it may be better to stop execution.

 - Previously we just printed a warning and didn't handle the fault,
   this is arguable for the above reason.

 - All other *SAVE instruction also don't handle exceptions, so this
   at least aligns behavior.

Finally add a test to catch such a regression in the future.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #13042
Closes #13059
2022-02-09 12:50:10 -08:00
..
cityhash.c Compile cityhash code into libzfs 2020-03-27 09:11:22 -07:00
Makefile.in Linux 5.10 compat: use iov_iter in uio structure 2020-12-18 08:48:26 -08:00
zfeature_common.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_comutil.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_deleg.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_fletcher_aarch64_neon.c Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_fletcher_avx512.c Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_fletcher_intel.c Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_fletcher_sse.c Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_fletcher_superscalar4.c Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_fletcher_superscalar.c Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_fletcher.c Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_namecheck.c Allow pool names that look like Solaris disk names 2021-04-01 08:49:41 -07:00
zfs_prop.c Linux 5.16 compat: don't use XSTATE_XSAVE to save FPU state 2022-02-09 12:50:10 -08:00
zpool_prop.c zcommon: pre-iterate over sysfs instead of statting every feature 2021-12-16 16:43:10 -08:00
zprop_common.c module: zcommon: zprop: fix unused, remove argsused 2021-12-23 09:42:47 -08:00