VirtualBox

Ignore:
Timestamp:
Mar 29, 2017 4:22:31 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114278
Message:

IEM: Converted grp 9 to tables and fixed cmpxchg16b/8b prefix handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-decoding-1.c32

    r66341 r66342  
    406406CPUDECODE1UDTST const g_aUdTest2Byte_0f[] =
    407407{
    408 #if 1
     408#if 0
    409409    {  UD_T_EXACT, 2, { 0x0f, 0x04 }, UD_F_ANY_PFX },
    410410    {  UD_T_EXACT, 2, { 0x0f, 0x0a }, UD_F_ANY_PFX },
     
    536536    {  UD_T_MODRM_MR0, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX },
    537537    {  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. @
    539539    {  UD_T_MODRM_RR1, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX },
    540540    {  UD_T_MODRM_MR2, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX },
     
    546546    {  UD_T_MODRM_MR5, 2, { 0x0f, 0xc7 }, UD_F_ANY_PFX },
    547547    {  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
    551553    {  UD_T_MODRM, 2, { 0x0f, 0xd0 }, UD_F_NOT_OZ_PFX | UD_F_NOT_RN_PFX },
    552554    {  UD_T_MODRM, 2, { 0x0f, 0xd1 }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX },
     
    12901292
    12911293
     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 */
     1303static 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
    12921328/**
    12931329 * Checks various prefix encodings with the MOVBE and CRC32 instructions to try
     
    16611697    Bs3TestPrintf("g_uBs3CpuDetected=%#x\n", g_uBs3CpuDetected);
    16621698
    1663 #if 1
     1699#if 0
    16641700    Bs3TestSub("CMPPS, CMPPD, CMPSS, CMPSD");
    16651701    DecodeCmppsCmppdCmpssCmpsd();
     
    16681704    DecodeMovbeVsCrc32();
    16691705#endif
     1706
     1707    //Bs3TestSub("CMPXCHG8B/16B");
     1708    //DecodeCmpXchg8bVs16b();
    16701709
    16711710#if 1
     
    16731712    DecodeUdEdgeTest(g_aUdTest2Byte_0f, RT_ELEMENTS(g_aUdTest2Byte_0f));
    16741713#endif
    1675 #if 1
     1714#if 0
    16761715    Bs3TestSub("3 byte undefined opcodes 0f 38");
    16771716    DecodeUdEdgeTest(g_aUdTest3Byte_0f_38, RT_ELEMENTS(g_aUdTest3Byte_0f_38));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette