diff options
author | Fabian-Gruenbichler <[email protected]> | 2019-12-10 21:53:25 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-12-10 12:53:25 -0800 |
commit | b119e2c6f185008001667a621521417111b21aa8 (patch) | |
tree | 19d6688391a9988b1372879d1a013319a9c09bdd /tests/zfs-tests | |
parent | 362ae8d11f81e5f65cd20aaf773075a3f045644d (diff) |
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/[email protected]/
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Fabian Grünbichler <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9608
Closes #9674
Diffstat (limited to 'tests/zfs-tests')
0 files changed, 0 insertions, 0 deletions