mirror_zfs/include/linux
Fabian-Gruenbichler 35155c0132 SIMD: Use alloc_pages_node to force alignment
fxsave and xsave require the target address to be 16-/64-byte aligned.

kmalloc(_node) does not (yet) offer such fine-grained control over
alignment[0,1], even though it does "the right thing" most of the time
for power-of-2 sizes. unfortunately, alignment is completely off when
using certain debugging or hardening features/configs, such as KASAN,
slub_debug=Z or the not-yet-upstream SLAB_CANARY.

Use alloc_pages_node() instead which allows us to allocate page-aligned
memory. Since fpregs_state is padded to a full page anyway, and this
code is only relevant for x86 which has 4k pages, this approach should
not allocate any unnecessary memory but still guarantee the needed
alignment.

0: https://lwn.net/Articles/787740/
1: https://lore.kernel.org/linux-block/20190826111627.7505-1-vbabka@suse.cz/

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9608
Closes #9674
2020-01-22 13:49:01 -08:00
..
blkdev_compat.h Add TRIM support 2019-03-29 09:13:20 -07:00
compiler_compat.h Update build system and packaging 2018-05-29 16:00:33 -07:00
dcache_compat.h cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
kmap_compat.h Linux 5.0 compat: access_ok() drops 'type' parameter 2019-01-28 10:11:10 -08:00
Makefile.am Linux 5.0 compat: SIMD compatibility 2020-01-22 13:49:01 -08:00
mod_compat.h Linux compat: Grsecurity kernel 2016-08-22 10:05:45 -07:00
page_compat.h Fix free memory calculation on v3.14+ 2018-02-23 08:50:06 -08:00
simd_aarch64.h Linux 5.0 compat: SIMD compatibility 2020-01-22 13:49:01 -08:00
simd_x86.h SIMD: Use alloc_pages_node to force alignment 2020-01-22 13:49:01 -08:00
simd.h Linux 5.0 compat: SIMD compatibility 2020-01-22 13:49:01 -08:00
utsname_compat.h Update utsname support 2014-10-17 14:58:57 -07:00
vfs_compat.h Fix typos in include/ 2020-01-22 13:48:59 -08:00
xattr_compat.h Linux 4.7 compat: handler->set() takes both dentry and inode 2016-06-01 18:10:06 -07:00