diff options
author | Fabian-Gruenbichler <[email protected]> | 2019-12-10 21:53:25 +0100 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2020-01-22 13:49:01 -0800 |
commit | 35155c013240ce14860b43ebc4803c2a5eea78f8 (patch) | |
tree | 5d2aa5b1ea9f94163cb47dd7212f61e28216a180 /config/kernel-in-compat-syscall.m4 | |
parent | 62c034f6d45df04fc81d6c7ca5bd884e17bfee19 (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 'config/kernel-in-compat-syscall.m4')
0 files changed, 0 insertions, 0 deletions