VirtualBox

Changeset 90197 in vbox


Ignore:
Timestamp:
Jul 14, 2021 10:17:51 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145718
Message:

VMM/tstVMMR0CallHost-1: Adjusted to stricter longjmp resuming. bugref:10064 ticketref:20090 ticketref:20456

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp

    r86403 r90197  
    5454/** Number of bytes used last time we called foo(). */
    5555static intptr_t volatile    g_cbFooUsed;
     56/** Set if we're in a long jump. */
     57static bool                 g_fInLongJmp;
    5658
    5759
     
    8082    {
    8183        g_cJmps++;
     84        g_fInLongJmp = true;
    8285        int rc = vmmR0CallRing3LongJmp(&g_Jmp, 42);
     86        g_fInLongJmp = false;
    8387        if (!rc)
    8488            return i + 10000;
     
    130134    g_cJmps = 0;
    131135    g_cbFooUsed = 0;
    132 
     136    g_fInLongJmp = false;
     137
     138    int iOrg = iFrom;
    133139    for (int i = iFrom, iItr = 0; i != iTo; i += iInc, iItr++)
    134140    {
    135         int rc = stackRandom(&g_Jmp, (PFNVMMR0SETJMP)(uintptr_t)tst2, (PVM)(uintptr_t)i, 0);
    136         RTTESTI_CHECK_MSG_RETV(rc == 0 || rc == 42, ("i=%d rc=%d setjmp; cbFoo=%#x cbFooUsed=%#x\n", i, rc, g_cbFoo, g_cbFooUsed));
     141        if (!g_fInLongJmp)
     142            iOrg = i;
     143        int rc = stackRandom(&g_Jmp, (PFNVMMR0SETJMP)(uintptr_t)tst2, (PVM)(uintptr_t)iOrg, 0);
     144        RTTESTI_CHECK_MSG_RETV(rc == (g_fInLongJmp ? 42 : 0),
     145                               ("i=%d iOrg=%d rc=%d setjmp; cbFoo=%#x cbFooUsed=%#x fInLongJmp=%d\n",
     146                                i, iOrg, rc, g_cbFoo, g_cbFooUsed, g_fInLongJmp));
    137147
    138148#ifdef VMM_R0_SWITCH_STACK
     
    168178     */
    169179    RTTEST hTest;
     180#ifdef VMM_R0_NO_SWITCH_STACK
    170181    RTEXITCODE rcExit = RTTestInitAndCreate("tstVMMR0CallHost-1", &hTest);
     182#else
     183    RTEXITCODE rcExit = RTTestInitAndCreate("tstVMMR0CallHost-2", &hTest);
     184#endif
    171185    if (rcExit != RTEXITCODE_SUCCESS)
    172186        return rcExit;
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