Changeset 60428 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 11, 2016 2:33:04 PM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r60377 r60428 373 373 if (pXApicPage->svr.u.fApicSoftwareEnable) 374 374 { 375 int const irrv = apicGetLastSetBit(&pXApicPage->irr, VERR_NOT_FOUND);375 int const irrv = apicGetLastSetBit(&pXApicPage->irr, -1 /* rcNotFound */); 376 376 if (irrv >= 0) 377 377 { … … 963 963 static VBOXSTRICTRC apicSetTpr(PVMCPU pVCpu, uint32_t uTpr) 964 964 { 965 VMCPU_ASSERT_EMT _OR_NOT_RUNNING(pVCpu);965 VMCPU_ASSERT_EMT(pVCpu); 966 966 967 967 if ( XAPIC_IN_X2APIC_MODE(pVCpu) … … 993 993 994 994 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu); 995 int isrv = apicGetLastSetBit(&pXApicPage->isr, VERR_NOT_FOUND);995 int isrv = apicGetLastSetBit(&pXApicPage->isr, -1 /* rcNotFound */); 996 996 if (isrv >= 0) 997 997 { … … 1546 1546 return VINF_CPUM_R3_MSR_READ; 1547 1547 1548 STAM_COUNTER_INC(&VMCPU_TO_APICCPU(pVCpu)->StatMsr Write);1548 STAM_COUNTER_INC(&VMCPU_TO_APICCPU(pVCpu)->StatMsrRead); 1549 1549 1550 1550 VBOXSTRICTRC rcStrict = VINF_SUCCESS; … … 1904 1904 VMMDECL(uint8_t) APICGetTpr(PPDMDEVINS pDevIns, PVMCPU pVCpu) 1905 1905 { 1906 VMCPU_ASSERT_EMT _OR_NOT_RUNNING(pVCpu);1906 VMCPU_ASSERT_EMT(pVCpu); 1907 1907 PCXAPICPAGE pXApicPage = VMCPU_TO_CXAPICPAGE(pVCpu); 1908 1908 return pXApicPage->tpr.u8Tpr; … … 1961 1961 AssertReturn(u8Pin <= 1, VERR_INVALID_PARAMETER); 1962 1962 AssertReturn(u8Level <= 1, VERR_INVALID_PARAMETER); 1963 1964 LogFlow(("APIC%u: APICLocalInterrupt\n", pVCpu->idCpu)); 1963 1965 1964 1966 PCXAPICPAGE pXApicPage = VMCPU_TO_CXAPICPAGE(pVCpu); … … 2006 2008 VMCPUSET_ADD(&DestCpuSet, pVCpu->idCpu); 2007 2009 uint8_t const uVector = XAPIC_LVT_GET_VECTOR(uLvt); 2010 2011 Log4(("APIC%u: APICLocalInterrupt: Sending interrupt. enmDeliveryMode=%u u8Pin=%u uVector=%u\n", 2012 pVCpu->idCpu, enmDeliveryMode, u8Pin, uVector)); 2013 2008 2014 rcStrict = apicSendIntr(pVCpu, uVector, enmTriggerMode, enmDeliveryMode, &DestCpuSet, rcRZ); 2009 2015 break; … … 2026 2032 { 2027 2033 /* The APIC is disabled, pass it through the CPU. */ 2034 LogFlow(("APIC%u: APICLocalInterrupt: APIC hardware-disabled, passing interrupt to CPU. u8Pin=%u u8Level=%u\n", u8Pin, 2035 u8Level)); 2028 2036 if (u8Level) 2029 2037 APICSetInterruptFF(pVCpu, PDMAPICIRQ_EXTINT); … … 2052 2060 VMCPU_ASSERT_EMT(pVCpu); 2053 2061 2062 LogFlow(("APIC%u: APICGetInterrupt\n", pVCpu->idCpu)); 2063 2054 2064 PXAPICPAGE pXApicPage = VMCPU_TO_XAPICPAGE(pVCpu); 2055 2065 if ( apicIsEnabled(pVCpu) … … 2067 2077 uint8_t const uTpr = pXApicPage->tpr.u8Tpr; 2068 2078 if (uTpr > 0 && uVector <= uTpr) 2079 { 2080 Log4(("APIC%u: APICGetInterrupt: Returns spurious vector %#x\n", pVCpu->idCpu, 2081 pXApicPage->svr.u.u8SpuriousVector)); 2069 2082 return pXApicPage->svr.u.u8SpuriousVector; 2070 2071 apicClearVectorInReg(&pXApicPage->irr, uVector); 2072 apicSetVectorInReg(&pXApicPage->isr, uVector); 2073 apicUpdatePpr(pVCpu); 2074 apicSignalNextPendingIntr(pVCpu); 2075 return uVector; 2083 } 2084 2085 uint8_t const uPpr = pXApicPage->ppr.u8Ppr; 2086 if ( !uPpr 2087 || XAPIC_PPR_GET_PP(uVector) > XAPIC_PPR_GET_PP(uPpr)) 2088 { 2089 apicClearVectorInReg(&pXApicPage->irr, uVector); 2090 apicSetVectorInReg(&pXApicPage->isr, uVector); 2091 apicUpdatePpr(pVCpu); 2092 apicSignalNextPendingIntr(pVCpu); 2093 2094 Log4(("APIC%u: APICGetInterrupt: Returns vector %#x\n", pVCpu->idCpu, uVector)); 2095 return uVector; 2096 } 2076 2097 } 2077 2098 } … … 2094 2115 uint16_t offReg = (GCPhysAddr & 0xff0); 2095 2116 uint32_t uValue = 0; 2117 2096 2118 #ifdef VBOX_WITH_STATISTICS 2097 2119 PAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu); 2098 2120 STAM_COUNTER_INC(&CTXSUFF(pApicCpu->StatMmioRead)); 2099 2121 #endif 2122 2123 Log4(("APIC%u: ApicReadMmio: offReg=%#RX16\n", pVCpu->idCpu, offReg)); 2124 2100 2125 int rc = apicReadRegister(pApicDev, pVCpu, offReg, &uValue); 2101 2126 *(uint32_t *)pv = uValue; … … 2117 2142 uint16_t offReg = (GCPhysAddr & 0xff0); 2118 2143 uint32_t uValue = *(uint32_t *)pv; 2144 2119 2145 #ifdef VBOX_WITH_STATISTICS 2120 2146 PAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu); 2121 2147 STAM_COUNTER_INC(&CTXSUFF(pApicCpu->StatMmioWrite)); 2122 2148 #endif 2149 2150 LogRel(("APIC%u: APICWriteMmio: offReg=%#RX16\n", pVCpu->idCpu, offReg)); 2151 2123 2152 int rc = VBOXSTRICTRC_VAL(apicWriteRegister(pApicDev, pVCpu, offReg, uValue)); 2124 2153 return rc; … … 2177 2206 if (RT_LIKELY(uVector > XAPIC_ILLEGAL_VECTOR_END)) 2178 2207 { 2208 Log4(("APIC%u: APICPostInterrupt: uVector=%#x\n", pVCpu->idCpu, uVector)); 2179 2209 if (enmTriggerMode == XAPICTRIGGERMODE_EDGE) 2180 2210 { -
trunk/src/VBox/VMM/VMMR3/APIC.cpp
r60400 r60428 456 456 457 457 size_t cPending = 0; 458 pHlp->pfnPrintf(pHlp, " Pending\n");459 pHlp->pfnPrintf(pHlp, " ");458 pHlp->pfnPrintf(pHlp, " Pending:\n"); 459 pHlp->pfnPrintf(pHlp, " "); 460 460 for (ssize_t i = cFragments - 1; i >= 0; i--) 461 461 { … … 494 494 bool const fX2ApicMode = XAPIC_IN_X2APIC_MODE(pVCpu); 495 495 496 pHlp->pfnPrintf(pHlp, "VCPU[%u] APIC at %#RGp (%s mode):\n", pVCpu->idCpu, MSR_APICBASE_GET_PHYSADDR(pApicCpu->uApicBaseMsr),497 fX2ApicMode ? "x2APIC" : "xAPIC");496 pHlp->pfnPrintf(pHlp, "VCPU[%u] APIC at %#RGp\n", pVCpu->idCpu, MSR_APICBASE_GET_PHYSADDR(pApicCpu->uApicBaseMsr)); 497 pHlp->pfnPrintf(pHlp, " Mode = %s\n", fX2ApicMode ? "x2Apic" : "xApic"); 498 498 if (fX2ApicMode) 499 499 { … … 537 537 pHlp->pfnPrintf(pHlp, " IRR\n"); 538 538 apicR3DbgInfo256BitReg(&pXApicPage->irr, pHlp); 539 pHlp->pfnPrintf(pHlp, " ESR Internal= %#x\n", pApicCpu->uEsrInternal);539 pHlp->pfnPrintf(pHlp, " ESR Internal = %#x\n", pApicCpu->uEsrInternal); 540 540 pHlp->pfnPrintf(pHlp, " ESR = %#x\n", pXApicPage->esr.all.u32Errors); 541 541 pHlp->pfnPrintf(pHlp, " Redirectable IPI = %RTbool\n", pXApicPage->esr.u.fRedirectableIpi); … … 574 574 uint32_t const uLvtTimer = pXApicPage->lvt_timer.all.u32LvtTimer; 575 575 pHlp->pfnPrintf(pHlp, "LVT Timer = %#RX32\n", uLvtTimer); 576 pHlp->pfnPrintf(pHlp, " Vector = %u (%#x)\n", pXApicPage->lvt_timer.u.u8Vector );576 pHlp->pfnPrintf(pHlp, " Vector = %u (%#x)\n", pXApicPage->lvt_timer.u.u8Vector, pXApicPage->lvt_timer.u.u8Vector); 577 577 pHlp->pfnPrintf(pHlp, " Delivery status = %u\n", pXApicPage->lvt_timer.u.u1DeliveryStatus); 578 578 pHlp->pfnPrintf(pHlp, " Masked = %RTbool\n", XAPIC_LVT_IS_MASKED(uLvtTimer)); … … 626 626 apicGetTriggerModeName((XAPICTRIGGERMODE)pXApicPage->lvt_lint0.u.u1TriggerMode)); 627 627 pHlp->pfnPrintf(pHlp, " Masked = %RTbool\n", XAPIC_LVT_IS_MASKED(uLvtLint0)); 628 pHlp->pfnPrintf(pHlp, "\n"); 628 629 629 630 uint32_t const uLvtLint1 = pXApicPage->lvt_lint1.all.u32LvtLint1; … … 665 666 pHlp->pfnPrintf(pHlp, " DCR = %#RX32\n", pXApicPage->timer_dcr.all.u32DivideValue); 666 667 pHlp->pfnPrintf(pHlp, " Timer shift = %#x\n", apicGetTimerShift(pXApicPage)); 667 pHlp->pfnPrintf(pHlp, " Timer initial TS = %#RU64 ", pApicCpu->u64TimerInitial);668 pHlp->pfnPrintf(pHlp, " Timer initial TS = %#RU64\n", pApicCpu->u64TimerInitial); 668 669 pHlp->pfnPrintf(pHlp, "\n"); 669 670 … … 1296 1297 PAPICCPU pApicCpu0 = VMCPU_TO_APICCPU(&pVM->aCpus[0]); 1297 1298 RTGCPHYS GCPhysApicBase = MSR_APICBASE_GET_PHYSADDR(pApicCpu0->uApicBaseMsr); 1298 rc = PDMDevHlpMMIORegister(pDevIns, GCPhysApicBase, sizeof(XAPICPAGE), pVM, 1299 LogRel(("APIC: PDMDevHlpMMIORegister new = %#RGp\n", GCPhysApicBase)); 1300 rc = PDMDevHlpMMIORegister(pDevIns, GCPhysApicBase, sizeof(XAPICPAGE), NULL /* pvUser */, 1299 1301 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, 1300 1302 APICWriteMmio, APICReadMmio, "APIC");
Note:
See TracChangeset
for help on using the changeset viewer.