VirtualBox

Changeset 10110 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jul 2, 2008 2:22:41 PM (16 years ago)
Author:
vboxsync
Message:

More TPR updates

File:
1 edited

Legend:

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

    r10108 r10110  
    253253    /* Program the control fields. Most of them never have to be changed again. */
    254254    /* CR0/3/4 reads must be intercepted, our shadow values are not necessarily the same as the guest's. */
    255     /* Note: CR8 reads will refer to V_TPR, so no need to catch them. */
    256255    /** @note CR0 & CR4 can be safely read when guest and shadow copies are identical. */
    257256    if (!pVM->hwaccm.s.fNestedPaging)
     
    264263     */
    265264    if (!pVM->hwaccm.s.fNestedPaging)
    266         pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(3) | RT_BIT(4) | RT_BIT(8);
     265        pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(3) | RT_BIT(4);
    267266    else
    268         pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(4) | RT_BIT(8);
     267        pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(4);
    269268
    270269    /* Intercept all DRx reads and writes. */
     
    744743#endif
    745744
     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;
     751
    746752    /* Done. */
    747753    pVM->hwaccm.s.fContextUseFlags &= ~HWACCM_CHANGED_ALL_GUEST;
     
    11061112    pCtx->dr6 = pVMCB->guest.u64DR6;
    11071113    pCtx->dr7 = pVMCB->guest.u64DR7;
     1114
     1115    /* Update the APIC if the cached TPR value has changed. */
     1116    if (pVMCB->ctrl.IntCtrl.n.u8VTPR != pCtx->cr8)
     1117    {
     1118        rc = PDMApicSetTPR(pVM, pVMCB->ctrl.IntCtrl.n.u8VTPR);
     1119        AssertRC(rc);
     1120        pCtx->cr8 = pVMCB->ctrl.IntCtrl.n.u8VTPR;
     1121    }
     1122    pVMCB->ctrl.IntCtrl.n.u8VTPR = pCtx->cr8;
    11081123
    11091124    /* Check if an injected event was interrupted prematurely. */
     
    14941509            break;
    14951510        case 8:
     1511            AssertFailed(); /* shouldn't come here anymore */
    14961512            pVM->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_CR8;
    14971513            break;
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