VirtualBox

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


Ignore:
Timestamp:
May 9, 2013 3:39:52 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Only cause a VM-exit when the highest-priority pending interrupt can be delivered to the guest and not whenever the guest lowers its TPR.

File:
1 edited

Legend:

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

    r45965 r45966  
    24852485            Assert(pVCpu->hm.s.vmx.HCPhysVirtApic);
    24862486
    2487             bool    fPendingIntr = false;
    2488             uint8_t u8GuestTpr   = 0;
    2489             rc = PDMApicGetTPR(pVCpu, &u8GuestTpr, &fPendingIntr, NULL /* pu8PendingIntr */);
     2487            bool    fPendingIntr  = false;
     2488            uint8_t u8Tpr         = 0;
     2489            uint8_t u8PendingIntr = 0;
     2490            rc = PDMApicGetTPR(pVCpu, &u8Tpr, &fPendingIntr, &u8PendingIntr);
    24902491            AssertRCReturn(rc, rc);
    24912492
     
    24962497             * the interrupt when we VM-exit for other reasons.
    24972498             */
    2498             pVCpu->hm.s.vmx.pbVirtApic[0x80] = u8GuestTpr;       /* Offset 0x80 is TPR in the APIC MMIO range. */
    2499             /* Bits 3-0 of the TPR threshold field correspond to bits 7-4 of the TPR (which is the Task-Priority Class). */
    2500             uint32_t u32TprThreshold = fPendingIntr ? (u8GuestTpr >> 4) : 0;
     2499            pVCpu->hm.s.vmx.pbVirtApic[0x80] = u8Tpr;            /* Offset 0x80 is TPR in the APIC MMIO range. */
     2500            uint32_t u32TprThreshold = 0;
     2501            if (fPendingIntr)
     2502            {
     2503                /* Bits 3-0 of the TPR threshold field correspond to bits 7-4 of the TPR (which is the Task-Priority Class). */
     2504                const uint8_t u8PendingPriority = (u8PendingIntr >> 4);
     2505                const uint8_t u8TprPriority     = (u8Tpr >> 4) & 7;
     2506                if (u8PendingPriority <= u8TprPriority)
     2507                    u32TprThreshold = u8PendingPriority;
     2508            }
    25012509            Assert(!(u32TprThreshold & 0xfffffff0));             /* Bits 31:4 MBZ. */
    25022510
     
    25082516            {
    25092517                Assert(!CPUMIsGuestInLongModeEx(pMixedCtx));     /* EFER always up-to-date. */
    2510                 pMixedCtx->msrLSTAR = u8GuestTpr;
     2518                pMixedCtx->msrLSTAR = u8Tpr;
    25112519                if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)
    25122520                {
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