VirtualBox

Changeset 108931 in vbox for trunk/src/VBox/VMM/testcase


Ignore:
Timestamp:
Apr 10, 2025 12:25:42 PM (4 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168440
Message:

VMM/testcase/tstPGMAllGst-armv8.cpp: Allow creating page table entries using named objects to make the layout more obvious, bugref:10388

Location:
trunk/src/VBox/VMM/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/testcase/tstPGMAllGst-armv8.cpp

    r108926 r108931  
    143143    PCTSTMEMCHUNK pChunk = (PCTSTMEMCHUNK)RTAvlrU64RangeGet(&g_MmuCfg.TreeMem, GCPhys);
    144144    if (!pChunk)
    145     {
    146         *ppv = (void *)&g_abRTZero64K[0]; /* This ASSUMES that the page table walking code will never access beyond the end of this page. */
    147         return VINF_SUCCESS;
    148     }
     145        return VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS;
    149146
    150147    uint64_t const off = GCPhys - pChunk->Core.Key;
     
    289286        switch (enmType)
    290287        {
     288            case RTJSONVALTYPE_TRUE:
     289            case RTJSONVALTYPE_FALSE:
     290            {
     291                if (paBitfields[idx].cBits == 1)
     292                    u64 |= (enmType == RTJSONVALTYPE_TRUE ? 1 : 0) << paBitfields[idx].offBitfield;
     293                else
     294                    RTTestFailed(hTest, "Bitfield '%s' is more than 1 bit wide", paBitfields[idx].pszName);
     295
     296                break;
     297            }
    291298            case RTJSONVALTYPE_INTEGER:
    292299            {
     
    299306                }
    300307                else if (   i64Tmp < 0
    301                          || (uint64_t)i64Tmp > (RT_BIT_64(paBitfields[idx].cBits) - 1))
     308                         || (   paBitfields[idx].cBits < 64
     309                             && (uint64_t)i64Tmp > (RT_BIT_64(paBitfields[idx].cBits) - 1)))
    302310                {
    303311                    RTTestFailed(hTest, "Value of \"%s\" is out of bounds, got %#RX64, maximum is %#RX64",
     
    539547            break;
    540548        }
     549        case RTJSONVALTYPE_OBJECT:
     550        {
     551            static const TSTCFGNAMEDVALUE s_aApPerm[] =
     552            {
     553                { "PRW",  0 },
     554                { "UPRW", 1 },
     555                { "PR",   2 },
     556                { "UPR",  3 },
     557                { NULL,   0 }
     558            };
     559            static const TSTCFGBITFIELD s_aTblBitfields[] =
     560            {
     561#define BITFIELD_CREATE_BOOL(a_Name, a_offBit) \
     562                { a_Name, a_offBit, 1, NULL }
     563
     564                { "Raw",       0, 64, NULL         },
     565                { "SwUse",    55,  4, NULL         },
     566                BITFIELD_CREATE_BOOL("UXN", 54),
     567                BITFIELD_CREATE_BOOL("PXN", 53),
     568                { "PhysAddr", 0, 64, NULL          },
     569                BITFIELD_CREATE_BOOL("AF",  10),
     570                { "AP",       6,  2, &s_aApPerm[0] },
     571                BITFIELD_CREATE_BOOL("T",    1),
     572                BITFIELD_CREATE_BOOL("V",    0),
     573                { NULL,     0, 0, NULL }
     574
     575#undef BITFIELD_CREATE_BOOL
     576            };
     577
     578            uint64_t u64Val = 0;
     579            rc = tstMmuCfgReadBitfieldU64(hTest, hMemObj, &s_aTblBitfields[0], &u64Val);
     580            if (RT_SUCCESS(rc))
     581                rc = tstTestcaseMmuMemoryWrite(hTest, pMmuCfg, GCPhysAddr, &u64Val, sizeof(u64Val));
     582            break;
     583        }
    541584        default:
    542585            RTTestFailed(hTest, "Memory object has an invalid type %d\n", enmType);
  • trunk/src/VBox/VMM/testcase/tstPGMAllGst-armv8.json

    r108926 r108931  
    5858        AddressSpace:
    5959        {
    60             0x0:    0x0000000000001fff,
    61             0x1000: 0x0000c000000000fd,
     60            0x0:    {                 PhysAddr:             0x1000,             T: 1, V: 1},
     61            0x1000: { UXN: 0, PXN: 0, PhysAddr: 0x0000c00000000000, AP: 'UPR',  T: 0, V: 1},
    6262        },
    6363
Note: See TracChangeset for help on using the changeset viewer.

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