VirtualBox

Ignore:
Timestamp:
Aug 30, 2021 2:04:48 PM (3 years ago)
Author:
vboxsync
Message:

VMM,PDM,PGM: Restrict the VMSetError and VMSetRuntimeError APIs to ring-3, these never worked properly in ring-0 or raw-mode. A PAEmode runtime error was the only place any of these were used, but given that the VMSetRuntimeError codepath starts with an assertion, it can't have been used/tested. The PAEmode runtime error shouldn't necessarily be triggered by PGM anyway, but IEM. Removed VMMCALLRING3_VM_SET_ERROR and VMMCALLRING3_VM_SET_RUNTIME_ERROR. bugref:10093

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/VMAll.cpp

    r82968 r90997  
    3333
    3434
     35#ifdef IN_RING3
     36
    3537/**
    3638 * Sets the error message.
     
    7375VMMDECL(int) VMSetErrorV(PVMCC pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args)
    7476{
    75 #ifdef IN_RING3
     77# ifdef IN_RING3
    7678    /*
    7779     * Switch to EMT.
     
    8385    va_end(va2);
    8486
    85 #else
     87# else
    8688    /*
    8789     * We're already on the EMT thread and can safely create a VMERROR chunk.
     
    8991    vmSetErrorCopy(pVM, rc, RT_SRC_POS_ARGS, pszFormat, args);
    9092    VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_VM_SET_ERROR, 0);
    91 #endif
     93# endif
    9294    return rc;
    9395}
     
    111113{
    112114    NOREF(pVM); NOREF(rc); RT_SRC_POS_NOREF(); NOREF(pszFormat); NOREF(args);
    113 #if 0 /// @todo implement Ring-0 and GC VMSetError
     115# if 0 /// @todo implement Ring-0 and GC VMSetError
    114116    /*
    115117     * Create the untranslated message copy.
     
    169171        pVM->vm.s.pErrorR3 = MMHyper2HC(pVM, (uintptr_t)pArgs.pErr);
    170172    }
    171 #endif
    172 }
    173 
     173# endif
     174}
     175
     176#endif /* IN_RING3 */
     177#ifdef IN_RING3
    174178
    175179/**
     
    245249    Assert(RTStrEnd(pszFormat, 512) != NULL);
    246250
    247 #ifdef IN_RING3
     251# ifdef IN_RING3
    248252    /*
    249253     * Switch to EMT.
     
    274278    }
    275279
    276 #else
     280# else
    277281    /*
    278282     * We're already on the EMT and can safely create a VMRUNTIMEERROR chunk.
     
    282286
    283287    int rc = VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_VM_SET_RUNTIME_ERROR, 0);
    284 #endif
     288# endif
    285289
    286290    Log(("VMSetRuntimeErrorV: returns %Rrc (pszErrorId=%s)\n", rc, pszErrorId));
     
    307311{
    308312    NOREF(pVM); NOREF(fFlags); NOREF(pszErrorId); NOREF(pszFormat); NOREF(va);
    309 #if 0 /// @todo implement Ring-0 and GC VMSetError
     313# if 0 /// @todo implement Ring-0 and GC VMSetError
    310314    /*
    311315     * Create the untranslated message copy.
     
    356360        pVM->vm.s.pErrorRuntimeR3 = MMHyper2HC(pVM, (uintptr_t)pArgs.pErr);
    357361    }
    358 #endif
    359 }
    360 
     362# endif
     363}
     364
     365#endif /* IN_RING3 */
    361366
    362367/**
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