]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/i386: Check CR0.TS before enter_mmx
authorMatt Borgerson <contact@mborgerson.com>
Thu, 13 Jul 2023 07:29:01 +0000 (00:29 -0700)
committerMichael Tokarev <mjt@tls.msk.ru>
Sat, 5 Aug 2023 17:49:23 +0000 (20:49 +0300)
commit5e4beb092dc0aa30b4b9474c17231a358e1711b1
treeb1833f0fbe84ce6cac2ae6bc4f31a7a99521d376
parent5a8fdead8556215b3d95a817f5edf8f38bcb2d16
target/i386: Check CR0.TS before enter_mmx

When CR0.TS=1, execution of x87 FPU, MMX, and some SSE instructions will
cause a Device Not Available (DNA) exception (#NM). System software uses
this exception event to lazily context switch FPU state.

Before this patch, enter_mmx helpers may be generated just before #NM
generation, prematurely resetting FPU state before the guest has a
chance to save it.

Signed-off-by: Matt Borgerson <contact@mborgerson.com>
Message-ID: <CADc=-s5F10muEhLs4f3mxqsEPAHWj0XFfOC2sfFMVHrk9fcpMg@mail.gmail.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit b2ea6450d8e1336a33eb958ccc64604bc35a43dd)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/i386/tcg/decode-new.c.inc