VirtualBox

Changeset 10206 in vbox


Ignore:
Timestamp:
Jul 4, 2008 8:36:48 AM (16 years ago)
Author:
vboxsync
Message:

Fixed regression introduced by TPR caching. (never execute code that can jump back to ring 3 in *LoadGuestState)

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

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

    r10110 r10206  
    513513 * Loads the guest state
    514514 *
     515 * NOTE: Don't do anything here that can cause a jump back to ring 3!!!!!
     516 *
    515517 * @returns VBox status code.
    516518 * @param   pVM         The VM to operate on.
     
    742744        pVMCB->ctrl.u32InterceptException &= ~RT_BIT(1);
    743745#endif
    744 
    745     /* TPR caching in CR8 */
    746     uint8_t u8TPR;
    747     int rc = PDMApicGetTPR(pVM, &u8TPR);
    748     AssertRC(rc);
    749     pCtx->cr8                    = u8TPR;
    750     pVMCB->ctrl.IntCtrl.n.u8VTPR = u8TPR;
    751746
    752747    /* Done. */
     
    856851    }
    857852    fGuestStateSynced = true;
     853
     854    /* TPR caching using CR8 is only available in 64 bits mode */
     855    /* Note the 32 bits exception for AMD (X86_CPUID_AMD_FEATURE_ECX_CR8L), but that appears missing in Intel CPUs */
     856    /* Note: we can't do this in LoadGuestState as PDMApicGetTPR can jump back to ring 3 (lock). */
     857    if (pCtx->msrEFER & MSR_K6_EFER_LMA)
     858    {
     859        /* TPR caching in CR8 */
     860        uint8_t u8TPR;
     861        int rc = PDMApicGetTPR(pVM, &u8TPR);
     862        AssertRC(rc);
     863        pCtx->cr8                    = u8TPR;
     864        pVMCB->ctrl.IntCtrl.n.u8VTPR = u8TPR;
     865    }
    858866
    859867    /* All done! Let's start VM execution. */
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r10108 r10206  
    655655/**
    656656 * Loads the guest state
     657 *
     658 * NOTE: Don't do anything here that can cause a jump back to ring 3!!!!!
    657659 *
    658660 * @returns VBox status code.
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