Changeset 66342 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-decoding-1.c32
- Timestamp:
- Mar 29, 2017 4:22:31 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114278
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-decoding-1.c32
r66341 r66342 406 406 CPUDECODE1UDTST const g_aUdTest2Byte_0f[] = 407 407 { 408 #if 1408 #if 0 409 409 { UD_T_EXACT, 2, { 0x0f, 0x04 }, UD_F_ANY_PFX }, 410 410 { UD_T_EXACT, 2, { 0x0f, 0x0a }, UD_F_ANY_PFX }, … … 536 536 { UD_T_MODRM_MR0, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX }, 537 537 { UD_T_MODRM_RR0, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX }, 538 //{ UD_T_MODRM_MR1, 2, { 0x0f, 0xc7 }, xxxx }, - cmpxchg8b/16b is weird, needs special testcase.538 //{ UD_T_MODRM_MR1, 2, { 0x0f, 0xc7 }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX | UD_F_NOT_RN_PFX | UD_F_NOT_RZ_PFX | UD_F_NOT_LK_PFX }, - cmpxchg8b ignores everything. @ 539 539 { UD_T_MODRM_RR1, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX }, 540 540 { UD_T_MODRM_MR2, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX }, … … 546 546 { UD_T_MODRM_MR5, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX }, 547 547 { UD_T_MODRM_RR5, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX }, 548 //{ UD_T_MODRM_MR0, 2, { 0x0f, 0xc7 }, UD_F_NOT_OZ_PFX | UD_F_NOT_RN_PFX | }, 549 { UD_T_MODRM_RR0, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX }, 550 #if 1 548 { UD_T_MODRM_MR6, 2, { 0x0f, 0xc7 }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX | UD_F_NOT_RZ_PFX }, /* f2? */ 549 { UD_T_MODRM_RR6, 2, { 0x0f, 0xc7 }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX }, /* (rdrand Rv) */ 550 { UD_T_MODRM_MR7, 2, { 0x0f, 0xc7 }, UD_F_NOT_NO_PFX }, /* vmptrst Mq (f2?); */ 551 { UD_T_MODRM_RR7, 2, { 0x0f, 0xc7 }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX | UD_F_NOT_RZ_PFX }, /* rdrand Rv; rdpid Rd/q (f2,66??); */ 552 #if 0 551 553 { UD_T_MODRM, 2, { 0x0f, 0xd0 }, UD_F_NOT_OZ_PFX | UD_F_NOT_RN_PFX }, 552 554 { UD_T_MODRM, 2, { 0x0f, 0xd1 }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX }, … … 1290 1292 1291 1293 1294 #if 0 1295 /** 1296 * Checks how prefixes affects cmpxchg8b and cmpxchg16b 1297 * 1298 * The thing here is that the intel opcode tables indicates that the 66 and f3 1299 * prefixes encodings are reserved and causes \#UD, where AMD doesn't. Seems 1300 * though that the f2, f3 and 66 prefixes are ignored on skylake intel. Need to 1301 * make sure this is the case, also in 64-bit mode and for the 16b version. 1302 */ 1303 static void DecodeCmpXchg8bVs16b(void) 1304 { 1305 uint8_t BS3_FAR *pbPages; 1306 1307 /* Check that the instructions are supported. */ 1308 if ( !(g_uBs3CpuDetected & BS3CPU_F_CPUID) 1309 || !(ASMCpuId_EDX(1) & X86_CPUID_FEATURE_EDX_CX8)) 1310 { 1311 Bs3TestSkipped("not supported"); 1312 return; 1313 } 1314 1315 /* Setup a guarded page. */ 1316 pbPages = Bs3MemGuardedTestPageAlloc(BS3MEMKIND_FLAT32); 1317 if (pbPages) 1318 { 1319 1320 Bs3MemGuardedTestPageFree(pbPages); 1321 } 1322 else 1323 Bs3TestFailed("Failed to allocate two pages!\n"); 1324 } 1325 #endif 1326 1327 1292 1328 /** 1293 1329 * Checks various prefix encodings with the MOVBE and CRC32 instructions to try … … 1661 1697 Bs3TestPrintf("g_uBs3CpuDetected=%#x\n", g_uBs3CpuDetected); 1662 1698 1663 #if 11699 #if 0 1664 1700 Bs3TestSub("CMPPS, CMPPD, CMPSS, CMPSD"); 1665 1701 DecodeCmppsCmppdCmpssCmpsd(); … … 1668 1704 DecodeMovbeVsCrc32(); 1669 1705 #endif 1706 1707 //Bs3TestSub("CMPXCHG8B/16B"); 1708 //DecodeCmpXchg8bVs16b(); 1670 1709 1671 1710 #if 1 … … 1673 1712 DecodeUdEdgeTest(g_aUdTest2Byte_0f, RT_ELEMENTS(g_aUdTest2Byte_0f)); 1674 1713 #endif 1675 #if 11714 #if 0 1676 1715 Bs3TestSub("3 byte undefined opcodes 0f 38"); 1677 1716 DecodeUdEdgeTest(g_aUdTest3Byte_0f_38, RT_ELEMENTS(g_aUdTest3Byte_0f_38));
Note:
See TracChangeset
for help on using the changeset viewer.