linux-user/i386: Fix allocation and alignment of fp state
commita7365e984d27b961f381cf3be46682e4da5ab6f7
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 9 Apr 2024 00:30:30 +0000 (8 14:30 -1000)
committerRichard Henderson <richard.henderson@linaro.org>
Sun, 26 May 2024 22:45:23 +0000 (26 15:45 -0700)
tree0c90234654191974d958488d5d9dcc9da818d34f
parent9e9b7d4c15b1cbefc608487a38e10c8f708fb187
linux-user/i386: Fix allocation and alignment of fp state

For modern cpus, the kernel uses xsave to store all extra
cpu state across the signal handler.  For xsave/xrstor to
work, the pointer must be 64 byte aligned.  Moreover, the
regular part of the signal frame must be 16 byte aligned.

Attempt to mirror the kernel code as much as possible.
Use enum FPStateKind instead of use_xsave() and use_fxsr().

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1648
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/i386/signal.c
tests/tcg/x86_64/Makefile.target
tests/tcg/x86_64/test-1648.c [new file with mode: 0644]