VirtualBox

Changeset 90471 in vbox


Ignore:
Timestamp:
Aug 2, 2021 11:24:07 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146075
Message:

bs3-locking-1: Test more, report some values. bugref:6695

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-locking-1.c

    r90463 r90471  
    6565        100 | (UINT32_C(50)  << VMMDEV_TESTING_LOCKED_WAIT_SHIFT) | VMMDEV_TESTING_LOCKED_POKE
    6666    },
     67    {
     68        "Contention 500us/250us poke void",
     69        2000 + 16384,
     70        500 | (UINT32_C(250) << VMMDEV_TESTING_LOCKED_WAIT_SHIFT) | VMMDEV_TESTING_LOCKED_POKE | VMMDEV_TESTING_LOCKED_BUSY_SUCCESS
     71    },
     72    {
     73        "Contention 50us/25us poke void",
     74        20000 + 4096,
     75        50 | (UINT32_C(25)  << VMMDEV_TESTING_LOCKED_WAIT_SHIFT) | VMMDEV_TESTING_LOCKED_POKE | VMMDEV_TESTING_LOCKED_BUSY_SUCCESS
     76    },
    6777};
    6878
     
    7080BS3_DECL(void) Main_rm()
    7181{
    72     uint64_t const  cNsPerTest = RT_NS_10SEC;
     82    uint64_t const  cNsPerTest = RT_NS_15SEC;
    7383    unsigned        i;
     84
    7485    Bs3InitAll_rm();
    7586    Bs3TestInit("bs3-locking-1");
     
    8192    for (i = 0; i < RT_ELEMENTS(g_aLockingTests); i++)
    8293    {
    83         uint64_t const nsStart = Bs3TestNow();
     94        uint64_t const nsStart    = Bs3TestNow();
     95        uint64_t       cNsElapsed = 0;
     96        uint32_t       cTotal     = 0;
    8497        uint32_t       j;
    8598
     
    87100        ASMOutU32(VMMDEV_TESTING_IOPORT_LOCKED, g_aLockingTests[i].uCtrlWord);
    88101
    89         for (j = 0; j < _2M; j++)
     102        for (j = 0; j < _2M && cTotal < _1G; j++)
    90103        {
    91             uint64_t cNsElapsed;
    92104
    93105            /* The inner loop should avoid calling Bs3TestNow too often, while not overshooting the . */
    94106            unsigned iInner = (unsigned)g_aLockingTests[i].cInnerLoops;
     107            cTotal += iInner;
    95108            while (iInner-- > 0)
    96109                ASMInU32(VMMDEV_TESTING_IOPORT_LOCKED);
     
    103116        /* Disable locking. */
    104117        ASMOutU32(VMMDEV_TESTING_IOPORT_LOCKED, 0);
     118
     119        Bs3TestValue("Loops", cTotal, VMMDEV_TESTING_UNIT_OCCURRENCES);
     120        Bs3TestValue("Elapsed", cNsElapsed, VMMDEV_TESTING_UNIT_NS);
    105121    }
    106122
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