mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-07 15:07:42 -07:00
target/i386: fix xsave.flat from kvm-unit-tests
xsave.flat checks that "executing the XSETBV instruction causes a general- protection fault (#GP) if ECX = 0 and EAX[2:1] has the value 10b". QEMU allows that option, so the test fails. Add the condition. Cc: qemu-stable@nongnu.org Fixes:892544317f("target/i386: implement XSAVE and XRSTOR of AVX registers", 2022-10-18) Reported-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit7604bbc2d8) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
2891807479
commit
d84afebcee
1 changed files with 5 additions and 0 deletions
|
|
@ -3012,6 +3012,11 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, uint64_t mask)
|
|||
goto do_gpf;
|
||||
}
|
||||
|
||||
/* SSE can be disabled, but only if AVX is disabled too. */
|
||||
if ((mask & (XSTATE_SSE_MASK | XSTATE_YMM_MASK)) == XSTATE_YMM_MASK) {
|
||||
goto do_gpf;
|
||||
}
|
||||
|
||||
/* Disallow enabling unimplemented features. */
|
||||
cpu_x86_cpuid(env, 0x0d, 0, &ena_lo, &dummy, &dummy, &ena_hi);
|
||||
ena = ((uint64_t)ena_hi << 32) | ena_lo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue