VirtualBox

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


Ignore:
Timestamp:
Jun 17, 2009 11:33:02 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48753
Message:

Update TPR only when changed.

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

Legend:

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

    r20655 r20660  
    856856    bool        fSyncTPR = false;
    857857    unsigned    cResume = 0;
    858     uint8_t     u8LastVTPR;
     858    uint8_t     u8LastTPR;
    859859    PHWACCM_CPUINFO pCpu = 0;
    860860    RTCCUINTREG uOldEFlags = ~(RTCCUINTREG)0;
     
    984984
    985985        /* TPR caching in CR8 */
    986         int rc = PDMApicGetTPR(pVCpu, &u8LastVTPR, &fPending);
     986        int rc = PDMApicGetTPR(pVCpu, &u8LastTPR, &fPending);
    987987        AssertRC(rc);
    988         pVMCB->ctrl.IntCtrl.n.u8VTPR = u8LastVTPR;
     988        pVMCB->ctrl.IntCtrl.n.u8VTPR = u8LastTPR;
    989989
    990990        if (fPending)
     
    13781378#endif
    13791379
    1380     if (fSyncTPR)
     1380    /* Sync back the TPR if it was changed. */
     1381    if (    fSyncTPR
     1382        &&  u8LastTPR != pVMCB->ctrl.IntCtrl.n.u8VTPR)
    13811383    {
    13821384        rc = PDMApicSetTPR(pVCpu, pVMCB->ctrl.IntCtrl.n.u8VTPR);
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r20655 r20660  
    20042004    RTGCUINTPTR intInfo = 0; /* shut up buggy gcc 4 */
    20052005    RTGCUINTPTR errCode, instrInfo;
    2006     bool        fSyncTPR = false;
    20072006    bool        fSetupTPRCaching = false;
     2007    uint8_t     u8LastTPR = 0;
    20082008    PHWACCM_CPUINFO pCpu = 0;
    20092009    RTCCUINTREG uOldEFlags = ~(RTCCUINTREG)0;
     
    22242224        AssertRC(rc);
    22252225        /* The TPR can be found at offset 0x80 in the APIC mmio page. */
    2226         pVCpu->hwaccm.s.vmx.pVAPIC[0x80] = u8TPR << 4; /* bits 7-4 contain the task priority */
     2226        u8LastTPR = pVCpu->hwaccm.s.vmx.pVAPIC[0x80] = u8TPR << 4; /* bits 7-4 contain the task priority */
    22272227
    22282228        /* Two options here:
     
    22342234        rc  = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, (fPending) ? u8TPR : 0);
    22352235        AssertRC(rc);
    2236 
    2237         /* Always sync back the TPR; we should optimize this though */ /** @todo optimize TPR sync. */
    2238         fSyncTPR = true;
    22392236    }
    22402237
     
    24262423    Log2(("IntInfo = %08x\n", (uint32_t)intInfo));
    24272424
    2428     if (fSyncTPR)
     2425    /* Sync back the TPR if it was changed. */
     2426    if (    fSetupTPRCaching
     2427        &&  u8LastTPR != pVCpu->hwaccm.s.vmx.pVAPIC[0x80])
    24292428    {
    24302429        rc = PDMApicSetTPR(pVCpu, pVCpu->hwaccm.s.vmx.pVAPIC[0x80] >> 4);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette