Legacy form of XRSTOR loads the MXCSR register from memory whenever the

RFBM[1](SSE) or RFBM[2](AVX) is set, regardless of the values of XSTATE_BV[1] and XSTATE_BV[2]
This commit is contained in:
Stanislav Shwartsman 2024-02-02 08:43:23 +02:00
parent fb8fc563ab
commit f3537f282a

View File

@ -357,8 +357,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XRSTOR(bxInstruction_c *i)
}
/////////////////////////////////////////////////////////////////////////////
if ((requested_feature_bitmap & restore_mask & BX_XCR0_SSE_MASK) != 0 ||
((requested_feature_bitmap & restore_mask & BX_XCR0_YMM_MASK) != 0 && ! compaction))
// Legacy form of XRSTOR loads the MXCSR register from memory whenever the
// RFBM[1](SSE) or RFBM[2](AVX) is set, regardless of the values of XSTATE_BV[1] and XSTATE_BV[2]
if (((requested_feature_bitmap & (BX_XCR0_SSE_MASK|BX_XCR0_YMM_MASK)) != 0 && ! compaction) ||
((requested_feature_bitmap & restore_mask & BX_XCR0_SSE_MASK) != 0))
{
// read cannot cause any boundary cross because XSAVE image is 64-byte aligned
Bit32u new_mxcsr = read_virtual_dword(i->seg(), eaddr + 24);