VirtualBox

Changeset 88670 in vbox


Ignore:
Timestamp:
Apr 23, 2021 8:48:45 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143984
Message:

APIC: When evaluating pending interrupts, do not take TPR into account, only the ISR. NEM/win depends on this behavior since it may need to get pending interrupts without an uptodate TPR (see bugref:9993).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/APICAll.cpp

    r88557 r88670  
    523523            Assert(irrv <= (int)UINT8_MAX);
    524524            uint8_t const uVector = irrv;
    525             uint8_t const uPpr    = pXApicPage->ppr.u8Ppr;
    526             if (   !uPpr
    527                 ||  XAPIC_PPR_GET_PP(uVector) > XAPIC_PPR_GET_PP(uPpr))
     525            int const isrv        = apicGetHighestSetBitInReg(&pXApicPage->isr, 0 /* rcNotFound */);
     526            Assert(isrv <= (int)UINT8_MAX);
     527            uint8_t const uIsrVec = isrv;
     528
     529            /* uIsrVect reflects the highest interrupt vector currently serviced (i.e. in ISR),
     530             * or zero if there's none. We want to report a pending interrupt only if IRR > ISR but
     531             * regardless of TPR. Hence we can't look at the PPR value, since that also reflects TPR.
     532             * NB: The APIC emulation will know when ISR changes, but not necessarily when TPR does.
     533             */
     534            if (XAPIC_PPR_GET_PP(uVector) > XAPIC_PPR_GET_PP(uIsrVec))
    528535            {
    529536                Log2(("APIC%u: apicSignalNextPendingIntr: Signalling pending interrupt. uVector=%#x\n", pVCpu->idCpu, uVector));
     
    532539            else
    533540            {
    534                 Log2(("APIC%u: apicSignalNextPendingIntr: Nothing to signal. uVector=%#x uPpr=%#x uTpr=%#x\n", pVCpu->idCpu,
    535                       uVector, uPpr, pXApicPage->tpr.u8Tpr));
     541                Log2(("APIC%u: apicSignalNextPendingIntr: Nothing to signal yet. uVector=%#x uIsrVec=%#x\n", pVCpu->idCpu, uVector, uIsrVec));
    536542            }
    537543        }
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