VirtualBox

Changeset 59137 in vbox for trunk


Ignore:
Timestamp:
Dec 15, 2015 4:35:35 PM (9 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Apparently hmR0VmxLoadGuestStateOptimal can fail (in PDMVmmDevHeapR3ToGCPhys), so check
its return code and bail ASAP to ring-3 if it happens to fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r59111 r59137  
    83158315 * Worker for loading the guest-state bits in the inner VT-x execution loop.
    83168316 *
     8317 * @returns Strict VBox status code (i.e. informational status codes too).
    83178318 * @param   pVM             The cross context VM structure.
    83188319 * @param   pVCpu           The cross context virtual CPU structure.
     
    83218322 *                          before using them.
    83228323 */
    8323 DECLINLINE(void) hmR0VmxLoadGuestStateOptimal(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
     8324static VBOXSTRICTRC hmR0VmxLoadGuestStateOptimal(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
    83248325{
    83258326    HMVMX_ASSERT_PREEMPT_SAFE();
     
    83308331#endif
    83318332
     8333    VBOXSTRICTRC rcStrict;
    83328334    if (HMCPU_CF_IS_SET_ONLY(pVCpu, HM_CHANGED_GUEST_RIP))
    83338335    {
    8334         int rc = hmR0VmxLoadGuestRip(pVCpu, pMixedCtx);
    8335         AssertRC(rc);
     8336        rcStrict = hmR0VmxLoadGuestRip(pVCpu, pMixedCtx);
     8337        if (RT_LIKELY(rcStrict == VINF_SUCCESS))
     8338        { /* likely */}
     8339        else
     8340        {
     8341            AssertLogRelMsgFailedReturn(("hmR0VmxLoadGuestStateOptimal: hmR0VmxLoadGuestRip failed! rc=%Rrc\n",
     8342                                         VBOXSTRICTRC_VAL(rcStrict)), rcStrict);
     8343        }
    83368344        STAM_COUNTER_INC(&pVCpu->hm.s.StatLoadMinimal);
    83378345    }
    83388346    else if (HMCPU_CF_VALUE(pVCpu))
    83398347    {
    8340         int rc = hmR0VmxLoadGuestState(pVM, pVCpu, pMixedCtx);
    8341         AssertRC(rc);
     8348        rcStrict = hmR0VmxLoadGuestState(pVM, pVCpu, pMixedCtx);
     8349        if (RT_LIKELY(rcStrict == VINF_SUCCESS))
     8350        { /* likely */}
     8351        else
     8352        {
     8353            AssertLogRelMsgFailedReturn(("hmR0VmxLoadGuestStateOptimal: hmR0VmxLoadGuestState failed! rc=%Rrc\n",
     8354                                         VBOXSTRICTRC_VAL(rcStrict)), rcStrict);
     8355        }
    83428356        STAM_COUNTER_INC(&pVCpu->hm.s.StatLoadFull);
    83438357    }
     
    83478361              ||  HMCPU_CF_IS_PENDING_ONLY(pVCpu, HM_CHANGED_HOST_CONTEXT | HM_CHANGED_HOST_GUEST_SHARED_STATE),
    83488362              ("fContextUseFlags=%#RX32\n", HMCPU_CF_VALUE(pVCpu)));
     8363    return rcStrict;
    83498364}
    83508365
     
    84468461     * Hence, this needs to be done -after- injection of events.
    84478462     */
    8448     hmR0VmxLoadGuestStateOptimal(pVM, pVCpu, pMixedCtx);
     8463    rcStrict = hmR0VmxLoadGuestStateOptimal(pVM, pVCpu, pMixedCtx);
     8464    if (RT_LIKELY(rcStrict == VINF_SUCCESS))
     8465    { /* likely */ }
     8466    else
     8467        return rcStrict;
    84498468
    84508469    /*
     
    88348853
    88358854/** @name Execution loop for single stepping, DBGF events and expensive Dtrace
     8855 *  probes.
    88368856 *
    88378857 * The following few functions and associated structure contains the bloat
     
    90319051
    90329052/**
    9033  * Configures exit controls for current DBGF and DTrace settings.
     9053 * Configures VM-exit controls for current DBGF and DTrace settings.
    90349054 *
    90359055 * This updates @a pDbgState and the VMCS execution control fields to reflect
     
    999810018
    999910019    /*
    10000      * Restore exit control settings as we may not reenter this function the
     10020     * Restore VM-exit control settings as we may not reenter this function the
    1000110021     * next time around.
    1000210022     */
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