- Timestamp:
- Apr 6, 2016 9:29:10 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r60340 r60345 443 443 XAPICDELIVERYMODE enmDeliveryMode, PCVMCPUSET pDestCpuSet, int rcRZ) 444 444 { 445 VBOXSTRICTRC rcStrict = VINF_SUCCESS;446 PVM pVM= pVCpu->CTX_SUFF(pVM);447 VMCPUID const cCpus = pVM->cCpus;445 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 446 PVM pVM = pVCpu->CTX_SUFF(pVM); 447 VMCPUID const cCpus = pVM->cCpus; 448 448 switch (enmDeliveryMode) 449 449 { … … 451 451 { 452 452 for (VMCPUID idCpu = 0; idCpu < cCpus; idCpu++) 453 if (VMCPUSET_IS_PRESENT(pDestCpuSet, idCpu)) 453 { 454 if ( VMCPUSET_IS_PRESENT(pDestCpuSet, idCpu) 455 && apicIsEnabled(&pVM->aCpus[idCpu])) 454 456 APICPostInterrupt(&pVM->aCpus[idCpu], uVector, enmTriggerMode); 457 } 455 458 break; 456 459 } … … 458 461 case XAPICDELIVERYMODE_LOWEST_PRIO: 459 462 { 460 VMCPUID idCpu = VMCPUSET_FIND_FIRST_PRESENT(pDestCpuSet);461 if ( idCpu != NIL_VMCPUID462 && idCpu < pVM->cCpus)463 VMCPUID const idCpu = VMCPUSET_FIND_FIRST_PRESENT(pDestCpuSet); 464 if ( idCpu < pVM->cCpus 465 && apicIsEnabled(&pVM->aCpus[idCpu])) 463 466 APICPostInterrupt(&pVM->aCpus[idCpu], uVector, enmTriggerMode); 464 467 break; … … 468 471 { 469 472 for (VMCPUID idCpu = 0; idCpu < cCpus; idCpu++) 473 { 470 474 if (VMCPUSET_IS_PRESENT(pDestCpuSet, idCpu)) 471 475 APICSetInterruptFF(&pVM->aCpus[idCpu], PDMAPICIRQ_SMI); 476 } 472 477 break; 473 478 } … … 476 481 { 477 482 for (VMCPUID idCpu = 0; idCpu < cCpus; idCpu++) 478 if (VMCPUSET_IS_PRESENT(pDestCpuSet, idCpu)) 483 { 484 if ( VMCPUSET_IS_PRESENT(pDestCpuSet, idCpu) 485 && apicIsEnabled(&pVM->aCpus[idCpu])) 479 486 APICSetInterruptFF(&pVM->aCpus[idCpu], PDMAPICIRQ_NMI); 487 } 480 488 break; 481 489 } … … 2171 2179 PCAPIC pApic = VM_TO_APIC(pVCpu->CTX_SUFF(pVM)); 2172 2180 PAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu); 2173 if (apicIsEnabled(pVCpu)) /* PAV */ 2174 { 2175 /* Validate the vector. See Intel spec. 10.5.2 "Valid Interrupt Vectors". */ 2176 if (RT_LIKELY(uVector > XAPIC_ILLEGAL_VECTOR_END)) 2177 { 2178 if (enmTriggerMode == XAPICTRIGGERMODE_EDGE) 2179 { 2180 apicSetVectorInPib(CTX_SUFF(pApicCpu->pvApicPib), uVector); 2181 bool const fAlreadySet = apicSetNotificationBitInPib(CTX_SUFF(pApicCpu->pvApicPib)); 2182 if (fAlreadySet) 2183 return; 2184 2185 if (pApic->fPostedIntrsEnabled) 2186 { /** @todo posted-interrupt call to hardware */ } 2187 else 2188 APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE); 2189 } 2181 /* Validate the vector. See Intel spec. 10.5.2 "Valid Interrupt Vectors". */ 2182 if (RT_LIKELY(uVector > XAPIC_ILLEGAL_VECTOR_END)) 2183 { 2184 if (enmTriggerMode == XAPICTRIGGERMODE_EDGE) 2185 { 2186 apicSetVectorInPib(CTX_SUFF(pApicCpu->pvApicPib), uVector); 2187 bool const fAlreadySet = apicSetNotificationBitInPib(CTX_SUFF(pApicCpu->pvApicPib)); 2188 if (fAlreadySet) 2189 return; 2190 2191 if (pApic->fPostedIntrsEnabled) 2192 { /** @todo posted-interrupt call to hardware */ } 2190 2193 else 2191 {2192 /*2193 * Level-triggered interrupts requires updating of the TMR and thus cannot be2194 * delivered asynchronously.2195 */2196 apicSetVectorInPib(&pApicCpu->ApicPibLevel.aVectorBitmap[0], uVector);2197 bool const fAlreadySet = apicSetNotificationBitInPib(&pApicCpu->ApicPibLevel.aVectorBitmap[0]);2198 if (fAlreadySet)2199 return;2200 2201 2194 APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE); 2202 }2203 2195 } 2204 2196 else 2205 apicSetError(pVCpu, XAPIC_ESR_RECV_ILLEGAL_VECTOR); 2206 } 2197 { 2198 /* 2199 * Level-triggered interrupts requires updating of the TMR and thus cannot be 2200 * delivered asynchronously. 2201 */ 2202 apicSetVectorInPib(&pApicCpu->ApicPibLevel.aVectorBitmap[0], uVector); 2203 bool const fAlreadySet = apicSetNotificationBitInPib(&pApicCpu->ApicPibLevel.aVectorBitmap[0]); 2204 if (fAlreadySet) 2205 return; 2206 2207 APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE); 2208 } 2209 } 2210 else 2211 apicSetError(pVCpu, XAPIC_ESR_RECV_ILLEGAL_VECTOR); 2207 2212 } 2208 2213
Note:
See TracChangeset
for help on using the changeset viewer.