[PATCH 0/3] linux-user: i386/signal: support XSAVE/XRSTOR for signal frame fpstate

Paolo Bonzini posted 3 patches 3 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221010142127.295676-1-pbonzini@redhat.com
Maintainers: Laurent Vivier <laurent@vivier.eu>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>
linux-user/i386/signal.c     | 227 ++++++++++++++++++++++++++---------
target/i386/cpu.c            |   2 +-
target/i386/cpu.h            |   3 +
target/i386/tcg/fpu_helper.c |  64 ++++++----
4 files changed, 210 insertions(+), 86 deletions(-)
[PATCH 0/3] linux-user: i386/signal: support XSAVE/XRSTOR for signal frame fpstate
Posted by Paolo Bonzini 3 years, 4 months ago
These three patches add support for x86 XSAVE/XRSTOR signal frames in
linux-user emulation.  This ensures that signals save and restore the
extended save states as well.

For 32-bit emulation not even FXSAVE was used, even though the
signal frame supports it.  Therefore, patch 2 extends 32-bit emulation
to use FXSAVE/FXRSTOR if the FXSR bit is set in CPUID.  If it is not
set, QEMU will use FSAVE/FRSTOR as usual; note that recent builds of
glibc most likely will check for FXSR bit even on 32-bit builds, and
will refuse to start with a "CPU ISA level is lower than required"
error.

Paolo

Paolo Bonzini (3):
  linux-user: i386/signal: move fpstate at the end of the 32-bit frames
  linux-user: i386/signal: support FXSAVE fpstate on 32-bit emulation
  linux-user: i386/signal: support XSAVE/XRSTOR for signal frame fpstate

 linux-user/i386/signal.c     | 227 ++++++++++++++++++++++++++---------
 target/i386/cpu.c            |   2 +-
 target/i386/cpu.h            |   3 +
 target/i386/tcg/fpu_helper.c |  64 ++++++----
 4 files changed, 210 insertions(+), 86 deletions(-)

-- 
2.37.3