VirtualBox

Ignore:
Timestamp:
Jul 14, 2008 4:17:10 PM (16 years ago)
Author:
vboxsync
Message:

Guest state loading and host state saving *must* be done after TPR handling as that code can jump back to ring 3 (!).

File:
1 edited

Legend:

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

    r10572 r10607  
    853853    }
    854854
    855     /* Load the guest state */
    856     rc = SVMR0LoadGuestState(pVM, pCtx);
    857     if (rc != VINF_SUCCESS)
    858     {
    859         STAM_PROFILE_ADV_STOP(&pVM->hwaccm.s.StatEntry, x);
    860         goto end;
    861     }
    862     fGuestStateSynced = true;
    863 
    864855    /* TPR caching using CR8 is only available in 64 bits mode */
    865856    /* Note the 32 bits exception for AMD (X86_CPUID_AMD_FEATURE_ECX_CR8L), but that appears missing in Intel CPUs */
    866     /* Note: we can't do this in LoadGuestState as PDMApicGetTPR can jump back to ring 3 (lock). */
     857    /* Note: we can't do this in LoadGuestState as PDMApicGetTPR can jump back to ring 3 (lock)!!!!!!!! */
    867858    if (pCtx->msrEFER & MSR_K6_EFER_LMA)
    868859    {
     
    897888     *       (until the actual world switch)
    898889     */
     890
     891    /* Load the guest state; *must* be here as it sets up the shadow cr0 for lazy fpu syncing! */
     892    rc = SVMR0LoadGuestState(pVM, pCtx);
     893    if (rc != VINF_SUCCESS)
     894    {
     895        STAM_PROFILE_ADV_STOP(&pVM->hwaccm.s.StatEntry, x);
     896        goto end;
     897    }
     898    fGuestStateSynced = true;
     899
    899900    pCpu = HWACCMR0GetCurrentCpu();
    900901    /* Force a TLB flush for the first world switch if the current cpu differs from the one we ran on last. */
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